By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Thread Suspend and Resume

P: n/a
Having not used threads for such a long time in vb.net I have found myself
in need of them

I have a thread that runs and retirieves live data from a SQL database, this
is running fine and has been doing its job for a long time

the problem is I need to suspend this thread when a checkbox is clicked (as
the data is no longer required) but when the checkbox is unclicked it needs
to restart

simple enough i thought Suspend/Resume exist, problem is as im sure your
aware, these appear to be on the way out (and will be removed completely
from the next version of the .net framework!!)

how do i now suspend/restart a thread without using defunct code???

ive searched the web for this and everything still points to suspend/resume,
which is of little help to me

thanks in advance

Mike Fellows
Oct 10 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Mike Fellows" <mi**********@equityhouse.NO.SPAM.co.ukschrieb
Having not used threads for such a long time in vb.net I have found
myself in need of them

I have a thread that runs and retirieves live data from a SQL
database, this is running fine and has been doing its job for a long
time

the problem is I need to suspend this thread when a checkbox is
clicked (as the data is no longer required) but when the checkbox is
unclicked it needs to restart

simple enough i thought Suspend/Resume exist, problem is as im sure
your aware, these appear to be on the way out (and will be removed
completely from the next version of the .net framework!!)

how do i now suspend/restart a thread without using defunct code???

ive searched the web for this and everything still points to
suspend/resume, which is of little help to me

thanks in advance

Mike Fellows

Simplest way is setting a boolean flag to have a Thread wait for something.
Then use an event (for example AutoResetEvent) set from outside to let the
Thread continue.
Armin

Oct 10 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.