< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] On using threads....



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

Scott Godin wrote:



 


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://www.amazon.com/exec/obidos/tg/detail/-/0131411551/002-2072848-1975233

or borrow an old:


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


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