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
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to