<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div><span>Provide two queues, one is for sending and another is for packet receiption. Both queues must have thread safety.<br></span></div><div><br></div>  <div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Ruud van Gaal <ruud@racer.nl><br> <b><span style="font-weight: bold;">To:</span></b> zxz3121 <zxz3121@gmail.com>; Discussion of the ENet library <enet-discuss@cubik.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, May 3, 2013 6:43 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [ENet-discuss] dangerous about function enet_host_flush<br> </font> </div> <div
 class="y_msg_container"><br><div id="yiv9100628059"><div dir="ltr">ENet isn't thread-safe, as you found out.<br></div><div class="yiv9100628059gmail_extra"><br><br><div class="yiv9100628059gmail_quote">On Fri, May 3, 2013 at 11:49 AM, <a rel="nofollow" ymailto="mailto:zxz3121@gmail.com" target="_blank" href="mailto:zxz3121@gmail.com">zxz3121@gmail.com</a> <span dir="ltr"><<a rel="nofollow" ymailto="mailto:zxz3121@gmail.com" target="_blank" href="mailto:zxz3121@gmail.com">zxz3121@gmail.com</a>></span> wrote:<br>
<blockquote class="yiv9100628059gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><u></u>





<div style="MARGIN:10px;">
<div> </div>
<div>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!
<hr style="WIDTH:210px;min-height:1px;" align="left" color="#b5c4df" size="1"><span class="yiv9100628059HOEnZb"><font color="#888888">
</font></span></div><span class="yiv9100628059HOEnZb"><font color="#888888">
<div><span><a rel="nofollow" ymailto="mailto:zxz3121@gmail.com" target="_blank" href="mailto:zxz3121@gmail.com">zxz3121@gmail.com</a></span></div></font></span></div>
<br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a rel="nofollow" ymailto="mailto:ENet-discuss@cubik.org" target="_blank" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
<br></blockquote></div><br></div></div><br>_______________________________________________<br>ENet-discuss mailing list<br><a ymailto="mailto:ENet-discuss@cubik.org" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br><a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br><br><br></div> </div> </div>  </div></body></html>