On Apr 13, 2022, at 3:40 AM, Zhaoxun Yan <yan.z...@gmail.com> wrote:
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9ca5c13b-7797-4d64-bc2c-1f1ff7281168n%40googlegroups.com.
On Apr 13, 2022, at 4:44 AM, Robert Engels <ren...@ix.netcom.com> wrote:
--
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/6ExktXrF5Xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7df07f32-d7aa-45db-91d6-de75e18ad8d8n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0c91adbb-94c7-4475-891d-3c4bb3d4e80dn%40googlegroups.com.
When one server finds something wrong, it sends out a request to another server for help.Then it makes a log and then a ticker to recheck the situation again and again and in the meantime, to receive a response from that server that indicates everything is fine.So here is a gap between sending help and getting ready to receive the "ok" response. It is a tiny gap but it is not possible that the other server sends the "ok" message back through TCP connection just in this gap. Yes my program handles the TCP message as always, in this case sends back through the channel to the goroutine that has not prepared the select for ticker channel and ok-receiving channel. Uh-oh, deadlock, crash! What is your suggestion? buffered channel?
In this case you already admit that opportunity that the sending happens when the receiver is not ready.
--
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/6ExktXrF5Xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9a0a275e-54cf-40da-b0ac-8ce724fc3d49n%40googlegroups.com.
Thanks for your demonstration, Brian.Actually my code involving cgo is quite like your first case, like this code:log("start testing")go func{forselectcase a: <=receivingcase <- killsig...}()subscribequotations( meanwhile the cgo of the dll will call back go functions to fill receiving channel)time.Sleep(3 * time.Seconds)disconnect and logkillsig <- true
I am really curious about your example on select - is it a try... except alternative?
--
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/6ExktXrF5Xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/452795b8-4817-4161-84e7-02665e24ae06n%40googlegroups.com.