Re: [reSIProcate] On using threads....
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