I'm running into a issue when running high concurrency using net/http.I'm getting deadlocks, using strace the program invariably blocks on:futex(0x1282e38, FUTEX_WAIT, 0, NULL...Essentially I'm getting social metrics for a bunch of domains, there are multiple stages of firing up goroutines. I run with a throttle, and by testing via runtime.NumCPU() all the way upto 128 concurrent workers - all levels of concurrency end in the FUTEX_WAITEach worker get's social data for the domain, e.g.:wg.Add(1)go func() {defer wg.Done()s.FacebookShares, s.FacebookComments = getFacebook(d)}()...Individual logic:type facebook struct {Shares uint64 `json:"shares,omitempty"`Comments uint64 `json:"comments,omitempty"`}const facebookURL = "https://graph.facebook.com/"func getFacebook(d string) (s, c uint64) {var wg sync.WaitGroupfor _, url := range []string{"http://" + d, "https://" + d} {wg.Add(1)go func(url string) {defer wg.Done()
wg.Add must not be called concurrently with wg.Done. http://golang.org/pkg/sync/#WaitGroup.Done
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/uSDwyjC75sc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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...@googlegroups.com.
Thanks for your code sample.
Can you please run your program to the point that you think it has stalled, the send it SIGQUIT and paste the entire output, it should be simple to figure it out from there
Dave
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/uSDwyjC75sc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.