At Wed, 17 Apr 2013 11:15:08 +0800, Liu Yuan wrote: > > On 04/16/2013 03:24 PM, MORITA Kazutaka wrote: > > @@ -509,6 +509,8 @@ int sheep_exec_req(const struct node_id *nid, struct > > sd_req *hdr, void *buf) > > struct sockfd *sfd; > > int ret; > > > > + assert(is_worker_thread()); > > + > > sfd = sheep_get_sockfd(nid); > > if (!sfd) > > return SD_RES_NETWORK_ERROR; > > Why exactly can't we call shep_exec_req in the main thread?
It is because exec_req() blocks in read/2 and write/2. If we call it in the main thread, sheep cannot accept any requests during the blocking time. Thanks, Kazutaka -- sheepdog mailing list [email protected] http://lists.wpkg.org/mailman/listinfo/sheepdog
