I just give up the enet_host_flush and shorten the delay of enet_host_service to 20ms ,all sending and reception just by itself 在 2013-5-4 上午3:00, <[email protected]>写道:
> Send ENet-discuss mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.cubik.org/mailman/listinfo/enet-discuss > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of ENet-discuss digest..." > > > Today's Topics: > > 1. dangerous about function enet_host_flush ([email protected]) > 2. Re: dangerous about function enet_host_flush (Ruud van Gaal) > 3. Re: dangerous about function enet_host_flush (Syed Setia Pernama) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 3 May 2013 17:49:59 +0800 > From: "[email protected]" <[email protected]> > To: enet-discuss <[email protected]> > Subject: [ENet-discuss] dangerous about function enet_host_flush > Message-ID: <[email protected]> > Content-Type: text/plain; charset="gb2312" > > > when I use two different threads for receive package and send package I > found that when I use enet_host_flush in send thread may occur Thread > synchronization problem randomly, because enet_host_flush and > enet_host_service may call the enet_protocol_send_outgoing_commands > function at the sametime?even I use the pthread_mutex_t in my threads > it`s crash randomly anyway! > > > [email protected] > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.cubik.org/pipermail/enet-discuss/attachments/20130503/a1d4d2d6/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Fri, 3 May 2013 12:43:18 +0200 > From: Ruud van Gaal <[email protected]> > To: zxz3121 <[email protected]>, Discussion of the ENet library > <[email protected]> > Subject: Re: [ENet-discuss] dangerous about function enet_host_flush > Message-ID: > < > cadulfbmjcuyvfjwwot2mu475fvmpo9v5xanshayxlbdpjmy...@mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > ENet isn't thread-safe, as you found out. > > > On Fri, May 3, 2013 at 11:49 AM, [email protected] <[email protected] > >wrote: > > > ** > > > > when I use two different threads for receive package and send package I > > found that when I use enet_host_flush in send thread may occur > > Thread synchronization problem randomly, because enet_host_flush and > > enet_host_service may call the enet_protocol_send_outgoing_commands > > function at the sametime?even I use the pthread_mutex_t in my threads > > it`s crash randomly anyway! > > ------------------------------ > > [email protected] > > > > _______________________________________________ > > ENet-discuss mailing list > > [email protected] > > http://lists.cubik.org/mailman/listinfo/enet-discuss > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.cubik.org/pipermail/enet-discuss/attachments/20130503/6e09c2f1/attachment-0001.html > > > > ------------------------------ > > Message: 3 > Date: Fri, 3 May 2013 04:52:39 -0700 (PDT) > From: Syed Setia Pernama <[email protected]> > To: Discussion of the ENet library <[email protected]> > Subject: Re: [ENet-discuss] dangerous about function enet_host_flush > Message-ID: > <[email protected]> > Content-Type: text/plain; charset="utf-8" > > Provide two queues, one is for sending and another is for packet > receiption. Both queues must have thread safety. > > > > ________________________________ > From: Ruud van Gaal <[email protected]> > To: zxz3121 <[email protected]>; Discussion of the ENet library < > [email protected]> > Sent: Friday, May 3, 2013 6:43 PM > Subject: Re: [ENet-discuss] dangerous about function enet_host_flush > > > > ENet isn't thread-safe, as you found out. > > > > > On Fri, May 3, 2013 at 11:49 AM, [email protected] <[email protected]> > wrote: > > > >? > >when I use?two different?threads for receive package and send > package? I found that when I use enet_host_flush in send thread may occur > Thread?synchronization??problem? randomly, because > enet_host_flush? and enet_host_service may? call the? > enet_protocol_send_outgoing_commands? function? at the sametime?even I > use the pthread_mutex_t? in my threads it`s crash randomly anyway! > >________________________________ > >[email protected] > >_______________________________________________ > >ENet-discuss mailing list > >[email protected] > >http://lists.cubik.org/mailman/listinfo/enet-discuss > > > > > > _______________________________________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/mailman/listinfo/enet-discuss > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.cubik.org/pipermail/enet-discuss/attachments/20130503/f0e8a722/attachment-0001.html > > > > ------------------------------ > > _______________________________________________ > ENet-discuss mailing list > [email protected] > http://lists.cubik.org/mailman/listinfo/enet-discuss > > > End of ENet-discuss Digest, Vol 119, Issue 4 > ******************************************** >
_______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
