Skip to contentSkip to conversation

suspending a thread and executing it later

DISCUSSION Lee Chin 1 participant 1 message Jan 18, 2003

lore
Share & tools
lore

Lee Chin

author
#0 lore raw

Hi,
Here is what I want to do... in my program, I want to arbitrarily in some function suspend the execution of the current (self) thread and schedule my self to resume from that point later.

In my program, I only have 2 threads... and lets say thread 1 ends up calling a function foo() that will block on IO. I dont want to make the whole system block, so I want to resume the execution of foo() when the IO completes and restore thread state so that the stack (function call history and all) is maintained.

How can I do this in Linux?

Thanks
Lee

Signature · 12 lines
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Meet Singles
http://corp.mail.com/lavalife

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs