[Live-devel] using live in multi-threaded environment

Chenglim Ear chenglim.ear at openwave.com
Wed Sep 8 12:30:20 PDT 2004


It has been said by Ross:

 

  Because the library code assumes a single thread of control, you should
not 

  have more than one thread accessing the library, *unless* each thread uses


  its own "UsageEnvironment" and "TaskScheduler" object.

 

  In other words, multiple threads can use the library code, but only if 

  they're performing independent activities.

 

Is this really true?  The groupsock libs seem to be using some static vars
that won't work in a multi-threaded environment.  In particular, I don't
think the random number generation is thread safe and I believe it gets used
for RTCP handling.

 

I have a situation where I have each thread using its own UsageEnvironment
and TaskScheduler instance and I got a core in a call to our_random() during
RTCP handling.  Is my alternative to run everything through a single thread?

 

Chenglim.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live.com/pipermail/live-devel/attachments/20040908/790ed048/attachment.html


More information about the live-devel mailing list