Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > OOP Powerplant for Mac > Problem suspend...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 414 of 484
Post > Topic >>

Problem suspending an LThread

by Kurt <kspaker1@[EMAIL PROTECTED] > Aug 4, 2005 at 02:50 PM

Hello,

I'm having trouble pausing LThreads (used to download data from a 
network). I first implemented this using a semaphore in the thread's 
run method. The problem is that each thread has to finish it's current 
task before the semaphore kicks in so with a lot of threads it takes 
several seconds for everything to actually pause.

Next I tried using Suspend() (called for all active threads from the 
main thread), which it seems is what I wanted in the first place. 
However, it doesn't do anything. The Suspend() function changes mState 
to threadState_Suspended, but then the thread gets swapped in anyway 
(from LThread::Yield()), with LThread::SwapContext changing the state 
back to threadState_Current. The thread then continues downloading data 
as usual.

How can I suspend an LThread such that it will not be swapped in, or 
given any cpu time, until I resume it?

Kurt
 




 1 Posts in Topic:
Problem suspending an LThread
Kurt <kspaker1@[EMAIL   2005-08-04 14:50:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 16:08:49 CST 2008.