[Live-devel] Scheduler Questions

Ross Finlayson finlayson at live.com
Mon Feb 9 18:18:48 PST 2004


>The potential issue I have is doing the fseek at the same time as the 
>fread.  How does the scheduler work?  Do i have to mutex these 
>accesses?  Or is everything still single threaded, so it wouldnt be a big deal.

That's correct - the code uses a single thread of execution, using an event 
loop - rather than multiple threads - for concurrency.  (Note the call to 
"TaskScheduler::doEventLoop()" in each of the test programs.)

So, you don't need to worry about your "fseek()" call interfering with the 
existing "fread()".

>The follow up question is, im targeting this application to a dual Xeon 
>system, so if this scheduler is single threaded, is it feasible to convert 
>it to a multi-threaded application?

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.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list