RE: [go-nuts] How ignore a subdirectory

2023-09-13 Thread 'John Souvestre' via golang-nuts
You are correct. However, “gofmt .” recurses. It turns out that they handle it differently. John John SouvestreNew Orleans LA, USA504-454-0899 From: golang-nuts@googlegroups.com On Behalf Of Brian Candler Sent: 2023-09-13, Wed 07:30 To: golang-nuts Subject: Re: [go

RE: [go-nuts] How ignore a subdirectory

2023-09-13 Thread 'John Souvestre' via golang-nuts
What is TIL? Installing WSL just to solve this seems like it might be overkill. A for loop in a batch file, or in DOSKEY, would suffice. John John SouvestreNew Orleans LA, USA504-454-0899 From: Jan Mercl <0xj...@gmail.com> Sent: 2023-09-13, Wed 05:33 To

RE: [go-nuts] How ignore a subdirectory

2023-09-13 Thread &#x27;John Souvestre' via golang-nuts
I did try that also. I get this error message: CreateFile *.go: The filename, directory name, or volume label syntax is incorrect. John John SouvestreNew Orleans LA, USA504-454-0899 -Original Message- From: Jan Mercl <0xj...@gmail.com> Sent: 2023-09-13, Wed 01

[go-nuts] How ignore a subdirectory

2023-09-12 Thread &#x27;John Souvestre' via golang-nuts
es to them in my code, however. Am I misunderstanding something? Or not doing something correctly? I’m doing this on Windows 10, by the way. Thanks, John John SouvestreNew Orleans LA, USA504-454-0899 -- You received this message because you are subscribed to t

RE: [go-nuts] question about GO and realtime GC interest by the user community

2017-11-26 Thread John Souvestre
Hi David. https://en.wikipedia.org/wiki/Real-time_computing#Firm Unfortunately I haven't seen much interest either. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of David Beberman Sent: 2017 Novemb

RE: [go-nuts] question about GO and realtime GC interest by the user community

2017-11-09 Thread John Souvestre
firm real-time would be a good first step? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of David Beberman Sent: 2017 November 09, Thu 05:59 To: golang-nuts Subject: [go-nuts] question about GO and realtime GC

RE: [go-nuts] Converting uint to string

2017-11-05 Thread John Souvestre
You could also just the integers themselves as keys. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Chun Zhang Sent: 2017 November 05, Sun 15:09 To: golang-nuts Subject: [go-nuts] Converting uint to string

RE: [go-nuts] Re: concurrency programing about go

2017-11-04 Thread John Souvestre
If you were to do that, yes. I guess it come to: How do you define “done” in your program? Waitgroup defines it as when all the goroutines which it counted are closed. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On

RE: [go-nuts] time.AddDate() odd behavior

2017-10-31 Thread John Souvestre
its his situation? The current method and a new method with a slightly different name, ex: AddEOM? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Alex Dvoretskiy Sent: 2017 October 31, Tue 16:20 To: golang-n

RE: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-10-29 Thread John Souvestre
John Souvestre - New Orleans LA From: Axel Wagner [mailto:axel.wagner...@googlemail.com] Sent: 2017 October 29, Sun 02:18 To: John Souvestre Cc: golang-nuts Subject: Re: [go-nuts] Re: select is still a little unfair if there are more than 4 cases? Apart from practical concerns about how

RE: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-10-28 Thread John Souvestre
live as long as the goroutine does, so it has to be at the very top. Dynamic sounds like the better way. How do you think the run-time overhead would compare to the current random method? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:gol

RE: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-10-28 Thread John Souvestre
that's being round-robined? An individual select statement across all goroutines? A select statement and goroutine pair? A select statement + function instance pair? An individual select in a goroutine. John John Souvestre - New Orleans LA From: golang-nuts@googlegroup

RE: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-10-28 Thread John Souvestre
elect)? John John Souvestre - New Orleans LA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more

RE: [go-nuts] will the following code always print two 1?

2017-10-22 Thread John Souvestre
Hi Dave. Oops! I read it as "pad". My bad. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Dave Cheney Sent: 2017 October 22, Sun 22:27 To: golang-nuts Subject: Re: [go-nuts] will the foll

RE: [go-nuts] will the following code always print two 1?

2017-10-22 Thread John Souvestre
Interesting. I hadn't heard this. Do you happen to recall where you ran across it? I did a fast (not comprehensive) look at about 10 files in Go\src\... in which I found "atomic.StoreUint". None of them seemed to use any padding. John John Souvestre - New Orleans LA

RE: [go-nuts] will the following code always print two 1?

2017-10-22 Thread John Souvestre
words, Go's atomics are full memory barriers/fences which guarantee sequential consistency for any number of goroutines. John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Dave Cheney Se

RE: [go-nuts] Latest Tiobe Ranking

2017-10-09 Thread John Souvestre
You could mention to your colleagues that if they scroll down on the Tiobe page they will find Go listed in their Hall of Fame as the "Programming Language of the Year" for 2009 and 2016. I second Ian's recommendation of Redmonk and IEEE - if you must reference any such lists.

RE: [go-nuts] Are all running goroutines killed when main ends?

2017-10-05 Thread John Souvestre
Any easy way to make their defers run? John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Dave Cheney Sent: 2017 October 05, Thu 23:36 To: golang-nuts Subject: [go-nuts] Are all running

RE: [go-nuts] Memory Safety

2017-10-04 Thread John Souvestre
Thanks for the info. I believe that Windows generally requires that user opt-in (set in the exe) for DEP and ASLR. However, it seems that Go exe's for Windows don't have the DEP opt-in set. Worth opening some issues? John John Souvestre - New Orleans LA -Original Message

[go-nuts] Memory Safety

2017-10-04 Thread John Souvestre
Does Go provide Data Execution Prevention (DEP) and Address space layout randomization (ASLR)? If not, any reasons why or any plans to implement? Thanks, John John Souvestre - New Orleans LA -- You received this message because you are subscribed to the Google Groups

[go-nuts] Go: Ten years and climbing

2017-09-21 Thread John Souvestre
Nice review by Rob Pike. https://commandcenter.blogspot.com/2017/09/go-ten-years-and-climbing.html John John Souvestre - New Orleans LA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

RE: [go-nuts] golang gc stop the world how to stop cpu busy goroutine?

2017-09-04 Thread John Souvestre
want to use sum1 by printing it (not inside the loop!). John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of ??? Sent: 2017 September 04, Mon 02:42 To: golang-nuts Subject: Re: [go-nuts] golang gc stop the world how to

RE: [go-nuts] golang gc stop the world how to stop cpu busy goroutine?

2017-09-04 Thread John Souvestre
I think that you put the call to runtime.Gosched() in the wrong place. You want to place it in the routine which needs to be pre-empted. In your example, in add1() inside the “for i” loop or in bar() in the “for” loop. John John Souvestre - New Orleans LA From: golang-nuts

RE: [go-nuts] Re: Running Go binary on a 56 core VM

2017-09-03 Thread John Souvestre
There are lots of variables, but even with a directly connected SSD drive (SATA bus, in my case) I can pretty well top out the file i/o, just doing sequential file reads, with about 3 – 4 CPUs. So increasing GOMAXPROCS (in this case) doesn’t help. John John Souvestre - New Orleans LA

RE: [go-nuts] golang gc stop the world how to stop cpu busy goroutine?

2017-09-03 Thread John Souvestre
can be a problem. An easy solution is to insert a call to runtime.Gosched() every so often. I believe that there is an ongoing discussion about a way for Go to plan ahead and be able to handle even these cases, but it’s something for the future. John John Souvestre - New Orleans LA

RE: [go-nuts] Go channels overused and hyped?

2017-08-18 Thread John Souvestre
nicating" as "passing on a channel the address of a data structure or an object ...". So I don't think that I'm alone in thinking that the focus of the proverb is to use channels to share memory, rather than any other way. And I find this somewhat wrong and certainly co

RE: [go-nuts] Go channels overused and hyped?

2017-08-18 Thread John Souvestre
P.S. And if you want to reduce it to a one-liner, how about this? Communicating is better than sharing sometimes, and vice versa. John John Souvestre - New Orleans LA From: John Souvestre [mailto:j...@souvestre.com] Sent: 2017 August 18, Fri 14:03 To: 'golang

RE: [go-nuts] Go channels overused and hyped?

2017-08-18 Thread John Souvestre
sharing memory is the goal and the solution it provides (communicating) is only right some of the time. Am I missing something? Should this be replaced? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of

RE: [go-nuts] multiply and divide

2017-08-18 Thread John Souvestre
might be a better approach. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Michael Jones Sent: 2017 August 18, Fri 11:50 To: golang-nuts Subject: [go-nuts] multiply and divide Here is a minor musing from

RE: [go-nuts] Is this bad concurrency?

2017-08-18 Thread John Souvestre
You might want to consider using a sync.WaitGroup. It’s for such situations. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of bill.war...@talentinc.com Sent: 2017 August 18, Fri 13:01 To: golang-nuts Subject

RE: [go-nuts] Re: Goroutines chan to get data at specific time

2017-08-07 Thread John Souvestre
I’m not sure exactly what you are trying to accomplish, but I suspect that this article would help you. https://blog.golang.org/go-concurrency-patterns-timing-out-and John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On

RE: [go-nuts] Re: No Allman-Style, No go!

2017-07-27 Thread John Souvestre
Cognitive dissonance J John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Michael Jones Sent: 2017 July 27, Thu 15:38 To: Rob Pike Cc: Ecstatic Coder; golang-nuts Subject: Re: [go-nuts] Re: No Allman-Style, No

RE: [go-nuts] Re: No Allman-Style, No go!

2017-07-27 Thread John Souvestre
it would in C. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of ecstatic.co...@gmail.com Sent: 2017 July 27, Thu 03:33 To: golang-nuts Cc: yout...@z505.com Subject: Re: [go-nuts] Re: No Allman-Style, No go!

RE: [go-nuts] Understanding least significant byte operation

2017-07-23 Thread John Souvestre
John Souvestre - New Orleans LA From: Jan Mercl [mailto:0xj...@gmail.com] Sent: 2017 July 23, Sun 13:52 To: John Souvestre; golang-nuts@googlegroups.com Subject: Re: [go-nuts] Understanding least significant byte operation On Sun, Jul 23, 2017 at 7:26 PM John Souvestre wrote: >

RE: [go-nuts] Understanding least significant byte operation

2017-07-23 Thread John Souvestre
I believe that the result is the least significant bit, not byte. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Pablo Rozas Larraondo Sent: 2017 July 23, Sun 07:51 To: golang-nuts Subject: [go-nuts

RE: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-14 Thread John Souvestre
h Rob and Ian confirm this in https://groups.google.com/forum/#!msg/golang-nuts/7EnEhM3U7B8/nKCZ17yAtZwJ John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Marvin Renich Sent: 2017 July 10, Mon 12:09 To: gol

RE: [go-nuts] negative unsigned value?

2017-05-22 Thread John Souvestre
That’s what I would say, too. If there is no legal way that it can be used, then it’s use must be illegal – hence fit for detection. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Michael Jones Sent: 2017

RE: [go-nuts] Re: Recover considered harmful

2017-04-30 Thread John Souvestre
var Panic func(error) = func(err error) { panic(err) } // Default: panic Also, this avoids using recover - which gets really messy if you have multiple spots where such an error can take place and the desired response might vary. John John Souvestre - New Orleans LA -Original Message---

RE: [go-nuts] Writing a non-blocking thread-safe buffer

2017-04-07 Thread John Souvestre
implemented this with channels first. If you need more throughput then I’d think mutexes next, and atomics as a last resort. Perhaps using an array as a circular buffer with read and write accesses synchronized by mutexes would be a good next step. John John Souvestre - New Orleans

RE: [go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread John Souvestre
Granted, but is this a common occurrence? Also, the workaround is easy. On the other hand, how common are the errors which would be caught by adding the test? John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts

RE: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-06 Thread John Souvestre
use epoll, but not sharing the memory. It sounds like it might be a nice option for the future, however. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Nick Rio Sent: 2017 March 06, Mon 02:26 To: golang-nuts

RE: [go-nuts] Re: How can I implement a TCP server using a model which similar to epoll (or kqueue, IOCP) rather than just using goroutine for each client?

2017-03-05 Thread John Souvestre
waste time on the wrong factor). Or perhaps the trial version will achieve your goals without having to do any optimization. J John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Nick Rio Sent: 2017 March 05

RE: [go-nuts] Re: [Newbie] Why this code is so slow?

2017-02-25 Thread John Souvestre
Changing just the mod operation to int32 made the whole program run about 2.5 times faster for me. Wow! I had no idea that there would be that much difference. John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts

RE: [go-nuts] Debugging long GC pauses

2017-02-23 Thread John Souvestre
Or… Call runtime.Gosched(). I seem to recall benchmarking it a while back and found that it was very efficient. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Jesper Louis Andersen Sent: 2017 February 23

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread John Souvestre
) int Power(base, exponent int) int Yes, I think that using named parameters (both calling and return) is good in general. Yes, there are cases (such as Add) where it doesn’t help, but it also doesn’t hurt. John John Souvestre - New Orleans LA From: Thomas Bushnell, BSG

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread John Souvestre
variables are new. I’ve taken to never using := in any multiple variable situation to avoid the problem. This is something that a ver or lint utility can check for now, too. J John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-21 Thread John Souvestre
Ø Again, named return values are fine and cause no problems, but naked returns should never have been part of the language (at first they seem useful and cool, but in the end, they cause more problems than they solve). I agree. Perhaps in Go 2? J John John Souvestre - New Orleans

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-21 Thread John Souvestre
ction's code to use the function, right? So how can the disparity be justified? Oh, and the longer the function is the more benefit there is to using them. John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegr

RE: [go-nuts] 17.3 trace.exe malware flag on win32

2017-02-06 Thread John Souvestre
I don’t see any problem when I scan it with BitDefender. I’m running the Internet Security 2016 version, build 20.0.29.1550. How about you? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of xiiop...@gmail.com

RE: [go-nuts] [Beginner question] Which language supports more concurrency models: Go or Java?

2017-02-06 Thread John Souvestre
should be >planning to build these yourself rather than using ones written by others. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of yinsi@gmail.com Sent: 2017 February 05, Sun 18:23 To: golang-nuts Subje

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-31 Thread John Souvestre
Interesting! Thanks. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Jonas August Sent: 2017 January 30, Mon 04:25 To: golang-nuts Subject: Re: [go-nuts] Is Go too strict for nesting function callings

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-29 Thread John Souvestre
But is it possible to finalize a discussion about finalizers? John John Souvestre - New Orleans LA From: Michael Jones [mailto:michael.jo...@gmail.com] Sent: 2017 January 29, Sun 20:38 To: Val Cc: golang-nuts; j...@souvestre.com Subject: Re: [go-nuts] Re: I know finalizers are not

[go-nuts] GOBIN Question

2017-01-29 Thread John Souvestre
at I believe I see described in all three of these: https://golang.org/cmd/go/ https://golang.org/doc/install/source https://github.com/golang/go/wiki/InstallTroubleshooting Is this a bug or am I missing something? John John Souvestre - New Orleans LA -- You received this

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
olang-dev/DMiUkpS1uyQ John John Souvestre - New Orleans LA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.co

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
> If finalizers were indeed totally useless, it would obviously be totally useless to implement support for them. If someone described a few cases where finalizers were useful perhaps it would help understand them. John John Souvestre - New Orleans LA -- You received this mess

RE: [go-nuts] Cross compile GOOS

2017-01-26 Thread John Souvestre
(GOOS=Darwin) & go build The () prevents adding a space to the end of the environment variable. John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Jakob Borg Sent: 2017 January 26, Thu 13:13

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
h variadac functions. But worst case an exception could handle this. J John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Dave Cheney Sent: 2017 January 25, Wed 22:12 To: golang-nuts Subject: Re: [go-nuts]

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
Hi Ian. OK, I understand now. Btw - I wasn't proposing adding an exception, but removing a limitation and the exception due to it. :) John John Souvestre - New Orleans LA -Original Message- From: Ian Lance Taylor [mailto:i...@golang.org] Sent: 2017 January 25, Wed 19:

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
Hi Caleb. Thanks! I see both the limitation and the exception. Other than implementation complexity, is there a reason for the limitation of single-valued expressions? Is there some fundamental problem with allowing multi-valued expressions that I'm missing? John John Souvestre

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
Then I'm still confused. Where is this inconsistency / limitation / non-orthogonal "syntactic sugar" defined? I'm trying to understand why it exists if perhaps it isn't necessary. John John Souvestre - New Orleans LA -Original Message- From: gol

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
Hi Dave. I believe that the example I posed is more fundamental, but along the same lines, than the one posed by TL. Perhaps not... Regardless, what is the rule you referred to? And is there any disadvantage to allowing the "syntactic sugar" to work in all cases? John John

RE: [go-nuts] Re: Priority cases in select?

2017-01-25 Thread John Souvestre
rupts. :) Digital designers generally classify races as either critical (bad) or non-critical (not bad). Indeed, some non-critical races are necessary else things wouldn't work. :) John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mai

RE: [go-nuts] Re: Priority cases in select?

2017-01-25 Thread John Souvestre
minute test run. On Windows I can’t sleep for less than 1ms, but I suspect that the real answer is more like 1us for practical (not absolutely guaranteed) usage. This is assuming the CPU isn’t loaded, too. J John John Souvestre - New Orleans LA From: John Souvestre [mailto:j

RE: [go-nuts] Re: Priority cases in select?

2017-01-25 Thread John Souvestre
I believe that there is a typo in your example. It seems that you have separate selects instead of nested selects. Try: https://play.golang.org/p/YWYhnLJsdS John John Souvestre - New Orleans LA From: Paul Borman [mailto:bor...@google.com] Sent: 2017 January 25, Wed 16:01 To

RE: [go-nuts] Is Go too strict for nesting function callings?

2017-01-25 Thread John Souvestre
Hi Dave. I'm trying to understand this. What is the rule? Does this mean that there is no way to call this function? func h(func()(int, bool)) {} Is there any disadvantage to not allowing the "syntactic sugar" to work in all cases? John John Souvestre - New Orleans LA

RE: [go-nuts] Re: Priority cases in select?

2017-01-25 Thread John Souvestre
. John John Souvestre - New Orleans LA From: Axel Wagner [mailto:axel.wagner...@googlemail.com] Sent: 2017 January 25, Wed 13:19 To: John Souvestre Cc: golang-nuts Subject: Re: [go-nuts] Re: Priority cases in select? Doesn't work. If no communication can proceed when entering the s

RE: [go-nuts] Re: Priority cases in select?

2017-01-25 Thread John Souvestre
case <- priorityLowest: ... } } } John John Souvestre - New Orleans LA From: 'Axel Wagner' via golang-nuts [mailto:golang-nuts@googlegroups.com] Sent: 2017 January 25, Wed 10:00 To: Egon Cc: golang-nuts Subject: Re: [go-nuts] Re: Priority cases in select? I don'

RE: [go-nuts] Re: Is there a 1 mb project to test compilation speed?

2017-01-08 Thread John Souvestre
Hi Dave. Am I correct in assuming that the build time is for a complete “build”, not an incremental “install”? If so, about how long does an updated install take for just minor changes? Thanks, John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
Hi Abhi. An afterthought: For the “done” case, add a check to clear out any “cs” values which might come in just before the “done” signal. You won’t need to worry about this in the “timeout” case. John John Souvestre - New Orleans LA From: John Souvestre [mailto:j

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
, change GetWorkerValues to be an endless loop containing a select with three cases: “<-cs” (add new value to array), “<-done” (break), and “<-timeout” (break). After the loop, send the array. John John Souvestre - New Orleans LA From: desaiabhi...@gmail.com [mailto:

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
are finished – timeout or not, thus it always contains the info for both workers. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of desaiabhi...@gmail.com Sent: 2017 January 08, Sun 06:24 To: golang-nuts Subject

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
Hi again. Did you perhaps intend to make the call to monitorWorker() as a goroutine? That would let it run in parallel with the rest of main. John John Souvestre - New Orleans LA From: John Souvestre [mailto:j...@souvestre.com] Sent: 2017 January 08, Sun 06:10 To: 'golang

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
Hi Abhi. I believe that the wait group timeout (in monitorWorker) was set to 2 seconds in the code you posted. I put a debugging print in the timeout case, and it is taking place. What were you expecting to see? John John Souvestre - New Orleans LA From: golang-nuts

RE: [go-nuts] Multiple goroutine timeout for waitgroup not working

2017-01-08 Thread John Souvestre
d 2 items might make it work. messges := make(chan *TestStruct, 2) I’m guessing, but I suspect that you didn’t realize that if Work1 runs first, then Work2 will block since the channel is full (or until you close it). John John Souvestre - New Orleans LA From: go

RE: [go-nuts] Re: too many runtime.gcBgMarkStartWorkers ?

2016-12-30 Thread John Souvestre
to do some scheduling for them. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of r...@golang.org Sent: 2016 December 30, Fri 09:53 To: golang-nuts Subject: [go-nuts] Re: too many runtime.gcBgMarkStartWork

RE: [go-nuts] Most efficient way to implement PubSub pattern using channels

2016-12-26 Thread John Souvestre
What is a partitioned channel? John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Zeeshan Arif Sent: 2016 December 25, Sun 19:05 To: golang-nuts Subject: [go-nuts] Most efficient way to

RE: [go-nuts] Re: Idiomatic way to remove duplicates in a slice

2016-12-14 Thread John Souvestre
Ø there is good gist. Ø this algorithm 10x faster … I don’t believe it is faster as the slice size increases. What you propose is O(N**2) vs O(N). Try a test with a slice 10 or 100 times the size. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com

RE: [go-nuts] Is it a compiler bug?

2016-11-12 Thread John Souvestre
Ø Also, prefixing all of the need-to-be-commented-out lines with // is always safe: https://play.golang.org/p/8Cot8lssO3 Except for perhaps: https://play.golang.org/p/9xiWFI-SgB John -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

RE: [go-nuts] Re: My Computer compiles go slower than my friends worse laptop

2016-11-06 Thread John Souvestre
You might add the Go directories/exe's to the exclusion list which most AV programs have. John John Souvestre - New Orleans LA -Original Message- From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Henry Sent: 2016 November 06, Sun 19:

RE: [go-nuts] Compiler level memory barrier in Go i.e. asm volatile("" : : : "memory")

2016-11-04 Thread John Souvestre
+1 Please note my new email address: j...@souvestre.com John John Souvestre - New Orleans LA -Original Message- From: Ian Lance Taylor [mailto:i...@golang.org] Sent: 2016 November 04, Fri 17:09 To: tsuna Cc: Rob Pike; John Souvestre; golang-nuts; Dmitry Vyukov Subject: Re: [go

RE: [go-nuts] Custom collation

2016-11-01 Thread John Souvestre
require a binary search for each lookup. After building the array, how about using it to build a map which would connect each of the entries to its order number – a “reversed” array, so to speak. This would reduce the lookup time from O(log n) to O(1). John John Souvestre - New Orleans

RE: [go-nuts] Re: There has no Mutex.Trylock() implemention or similar method ?

2016-10-23 Thread John Souvestre
Take a look at https://github.com/LK4D4/trylock/blob/master/trylock.go . I believe that it is easier and performs better. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of djad...@gmail.com Sent: 2016

RE: [go-nuts] Re: There has no Mutex.Trylock() implemention or similar method ?

2016-10-23 Thread John Souvestre
t looks like a TryLock function would look like this: > > func (m *Mutex) TryLock() bool { > return atomic.CompareAndSwapInt32(&m.state, 0, mutexLocked) > } > > Is this correct? If so, what's the problem? I don’t recall seeing an answer to his question, ho

RE: [go-nuts] infinite loop makes program stuck

2016-10-12 Thread John Souvestre
You are right. I misread that totally. Thanks! John John Souvestre - New Orleans LA From: Matt Harden [mailto:matt.har...@gmail.com] Sent: 2016 October 12, Wed 20:03 To: Minglangjun Li; John Souvestre Cc: golang-nuts Subject: Re: [go-nuts] infinite loop makes program stuck On

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
uarantee. And I believe that this statement is meant to cover both CPU and compiler ordering. John John Souvestre - New Orleans LA -Original Message- From: Konstantin Khomoutov [mailto:flatw...@users.sourceforge.net] Sent: 2016 October 12, Wed 11:40 To: John Souvestre Cc: 'golang-n

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
es such as those in the <https://golang.org/pkg/sync/> sync and <https://golang.org/pkg/sync/atomic/> sync/atomic packages.” John John Souvestre - New Orleans LA From: hiatt.dus...@gmail.com [mailto:hiatt.dus...@gmail.com] Sent: 2016 October 12, Wed 09:05 To: golang-nuts

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
– which Go’s sync/atomic operations provide. And I would certainly agree. John John Souvestre - New Orleans LA From: Henrik Johansson [mailto:dahankz...@gmail.com] Sent: 2016 October 12, Wed 07:01 To: John Souvestre; golang-nuts Subject: Re: [go-nuts] Re: Go locking and channels much

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
tuff unless you * really * need it for performance and you take the time to understand it well. A mutex lock would not prevent another goroutine from doing an atomic operation, for example. So mixing the two could be disastrous. But there are some cases where it can be done. John John

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
. John John Souvestre - New Orleans LA From: Henrik Johansson [mailto:dahankz...@gmail.com] Sent: 2016 October 12, Wed 03:02 To: John Souvestre; golang-nuts Subject: Re: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
platforms. Ø Don't I at least have to load the shared vars using atomic load (atomic.Value for example) or something similar? Not if everyone accessing them is using a mutex to synchronize the access. John John Souvestre - New Orleans LA From: golang-nuts@googlegroup

RE: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends most of time in sync.(*Mutex).Lock() and sync.(*Mutex).Unlock()

2016-10-12 Thread John Souvestre
. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of sphilip...@gmail.com Sent: 2016 October 04, Tue 04:10 To: golang-nuts Subject: [go-nuts] Re: Go locking and channels much slower than Java equivalent, program spends

RE: [go-nuts] infinite loop makes program stuck

2016-10-12 Thread John Souvestre
. If you get rid of the “select” then the loop will block until something comes in from the channel. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of liminglang...@gmail.com Sent: 2016 October 11, Tue 21:26 To

RE: [go-nuts] Re: Just because we can add multiple logical processors for the scheduler to use doesn’t mean we should

2016-09-24 Thread John Souvestre
hyperthreading results in more CPUs than cores. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of T L Sent: 2016 September 24, Sat 04:22 To: golang-nuts Subject: [go-nuts] Re: Just because we can add multiple

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
Or, if you have something else you’d rather be doing while waiting… https://play.golang.org/p/rhwEpWMhqF John John Souvestre - New Orleans LA From: John Souvestre [mailto:j...@souvestre.com] Sent: 2016 September 13, Tue 16:21 To: 'golang-nuts@googlegroups.com' Subject: RE

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
OK. Check this one out. https://play.golang.org/p/kO_96oykG1 John John Souvestre - New Orleans LA From: Evan Digby [mailto:evandi...@gmail.com] Sent: 2016 September 13, Tue 16:06 To: John Souvestre; golang-nuts@googlegroups.com Subject: Re: [go-nuts] Having difficulty testing this

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
. J John John Souvestre - New Orleans LA From: Evan Digby [mailto:evandi...@gmail.com] Sent: 2016 September 13, Tue 15:59 To: John Souvestre; golang-nuts Subject: Re: [go-nuts] Having difficulty testing this "cleanly" Hi John, What you've posted is a valid way t

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
Hi Evan. I still don’t quite understand exactly what you are shooting for. I tried to reimplement what you posted originally. Check out https://play.golang.org/p/koUJYCKFpa. Does this come close functionally? John John Souvestre - New Orleans LA From: golang-nuts

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
ne will execute in a timely fashion. I think that you’d have to call it before the goroutine. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Evan Digby Sent: 2016 September 13, Tue 14:59 To: golang-nuts Subjec

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
rring in the same function (main) that the Add is taking place earlier, there is no race. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Evan Digby Sent: 2016 September 13, Tue 14:19 To: golang-nuts Subjec

RE: [go-nuts] Having difficulty testing this "cleanly"

2016-09-13 Thread John Souvestre
hing else in mind can you elaborate on how it would help in this case? Thanks again! Evan On Tuesday, 13 September 2016 12:01:29 UTC-7, John Souvestre wrote: Have you considered using a sync.WaitGroup? John John Souvestre - New Orleans LA From: golan...@googlegr

  1   2   >