Hi, all I’m writing a chat server like program, and I must make a decision now. My business includes two kind of things: 1. request->response 2. push message
One solution is like every connection has 3 goroutines: 1. for read request 2. for write response 3. for execute request But this kind of solution will cause too much goroutines. I have seen “pthread_create failed” already. I digged net/rpc package code, and found that, rpc only use a long run goroutine for read, and a short term routine for excuting request, and it has no push requirement. So there is another solution maybe 1 long run routine for read request 1 short term routine for execute request (request should be sequenced, how?) 1 short term routine for write response (response should be sequenced, how?) My question is, is short term routine is a better practice than long run ones. If so, how to meet the sequence requirement? Thanks -- 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 options, visit https://groups.google.com/d/optout.