[reSIProcate] On using threads....

Alan Hawrylyshen alan at jasomi.com
Mon Aug 22 23:29:25 CDT 2005


On 22-Aug-05, at 22:10 , John Draper wrote:

> Scott Godin wrote:
>
>
>> http://warsaw.sjc.purplecomm.com/wiki/index.php?title=DUM_Threading
>> http://warsaw.sjc.purplecomm.com/wiki/index.php? 
>> title=FAQ#How_does_the_buildFdSet.2C_select.2C_process_loop_work.3F
>>
>>
>>
> from these docs....
>
> >It is important to ensure that the FdSet you pass in has been  
> generated by a call to buildFdSet and that is has >been used in a  
> select call
>
> Ok,  you got me here...  What is a "select call",  and how can I  
> determine the "FdSet" has been used
> in a select call.   Can't anyone just write up a few lines of  
> "sample code" to illustrate this process?
>
>        FdSet fdset;
>        stackUac.buildFdSet(fdset);
>
> It appears I'm calling this from within a loop?    (dum/test/ 
> BasicCall.cxx).
>
>        stackUac.process(fdset);      <---- This is called  
> repeatedly,   right?
>        while(dumUac->process());     <---- but this just loops  
> through a number of times?
>
> The "dumUac->process()" - Is this called for each "fd" in the set,   
> then it exits?
>
> Ok,  then what about SipThread and DUMThread?   Are these then just  
> an alternate way or
> method to "process" or do the polling?
>
> The document goes on to state.....
> >if you fail to call select then the process call will think all  
> file descriptors passed in are signaled, and this can >cause  
> unpredicable behaviour
>
> Ok,  you got me again here....  how and when would I want to call  
> "select"?   Obviously I have to,
> but how?    Again,  code fragments speak a thousand words.... I  
> can't even FIND a select() method
> call.  I know there is a call like this in the UNIX Socket API's,   
> is that what they mean?  And
> if they do,  then which object or class would be the one to call  
> "select".....  I global search
> finds a lot of them, so out of the ones I found,  how would I call  
> them?  I'm looking down
> very deep in the "call chain" so have no clue of it's overall  
> construct.
>
> John

And books with pictures speak infinitely more:

http://vip.cs.utsa.edu/concurrency/contents.html
http://www.amazon.com/exec/obidos/tg/detail/-/ 
0131411551/002-2072848-1975233

or borrow an old:

http://www.amazon.com/exec/obidos/tg/detail/-/0139498761/

And nobody should TOUCH a socket(2) without select(2)ing:

http://www.amazon.com/exec/obidos/tg/detail/-/0201563177/

while(unclear()) read(posix_init());

While you are at it, through in another look at TCP/IP illustrated  
and the GoF or a couple POSAs.

:-)
A

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20050822/8a76744a/attachment.htm>


More information about the resiprocate-devel mailing list