<div class="gmail_quote">On Tue, Jun 22, 2010 at 10:11 PM, Eric Norum <span dir="ltr"><<a href="mailto:wenorum@lbl.gov">wenorum@lbl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Jun 22, 2010, at 9:21 AM, Vinu Rajashekhar wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Tue, Jun 22, 2010 at 9:48 PM, Eric Norum <span dir="ltr"><<a href="mailto:wenorum@lbl.gov" target="_blank">wenorum@lbl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can read and write a socket from different threads.<br>
Just don't have multiple threads trying to read at the same time or trying to write at the same time.<br>
<div><div></div><div><br></div></div></blockquote><div><br></div><div>Yes, what if that happens, I don't care about the data being transferred.</div><div>I just want to wakeup select using the socket, then ?</div></div>
</blockquote><div><br></div></div>Are you doing a select waiting for read data to appear?</div><div>or are you doing a select waiting for space to become ready in a write queue?</div><div><br></div><div>Do you mean you do a write on one machine and want the 'select read' to wake up on the other machine?</div>
<div><br></div><div>It's not clear to me what you have in mind.</div><div class="im"><div><br></div></div></div></blockquote><div> </div><div>Ok. What I need to do is to wakeup a select call, that's all, on the same machine.</div>
<div><br></div><div>The original code, had a pipe whose read end would go into the set of fds in select.</div><div>But with RTEMS, since select can't wait on file descriptors, I can't use this. I can't</div><div>
use socketpairs in place of the pipe, by the way, since RTEMS doesn't support that.</div><div><br></div><div>So the solution is to use a plain sockets. I will write something into one socket, sw, </div><div>which should wakeup select, because it would be waiting on the socket at the other</div>
<div>end of the connection, socket sr. Basically replicating something like a pipe, but I don't</div><div>care about the data, just need to wakeup the select.</div><div><br></div><div>Now, this write into sw, can happen from more than one thread, at the same time.</div>
<div> that is a potential problem in RTEMS. So what is the solution for this problem ? </div><div>Is there a better solution to my problem ?</div><div><br></div><div>As an aside, is implementing socketpairs() in RTEMS very difficult at this point in time ?</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div class="im"><div></div><div><blockquote type="cite"><div class="gmail_quote"><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
On Jun 22, 2010, at 9:03 AM, Vinu Rajashekhar wrote:<br>
<br>
> From the networking documentation, it seems that one cannot<br>
> share the same socket across threads/tasks for the same operation, like<br>
> read or write.<br>
><br>
> What is the exact problem if I use the same socket to write something<br>
> across different threads, is data corruption the only problem? More specifically,<br>
> if I have run a select call on a socket, and if I write something into the socket,<br>
> from different threads, does the select wakeup for sure ?<br>
</div></div><div><div></div><div>> _______________________________________________<br>
> rtems-users mailing list<br>
> <a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
> <a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br>
--<br>
Eric Norum<br>
<a href="mailto:wenorum@lbl.gov" target="_blank">wenorum@lbl.gov</a><br>
<br>
</div></div></blockquote></div><br>
</blockquote></div><br></div><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>
-- <div class="im"><br>Eric Norum<br><a href="mailto:wenorum@lbl.gov" target="_blank">wenorum@lbl.gov</a></div></div></span>
</div>
<br></div></blockquote></div><br>