> In addition to htq and ltq you have a third queue into which you also > insert a token once one has been added to htq or ltp. The thread/goroutine > that serves htq, ltp, hq, lq is blocked by this additional queue. When it > is empty, htq and ltq are also empty. So when the goroutine is blocked it > is fine in this case. This sound like this could be it :-) >
Well, coming to think of it just using a sempahore here for the third queue consumes less memory: Just a counter that blocks the thread/goroutine once it has reached 0. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/29d45dcd-eb01-481b-b896-256d5209b1fdn%40googlegroups.com.