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

threading help

P: n/a
Hi all
i am having problem in vb.net application.
I am having one thread which is currently running.
AFter executing some part of thread procedure i want to suspend
execution of thread and only after user has selected option
to resume execution then only i want to execute remaining part of
thread procedure.

Currently i am using suspend and resume method of thread. But my
problem is i am not sure whether in thread procedure itself suspending
thread is proper way or not.
Simiarly i am not sure whether to use suspend and resume or not.
Because i have so many threads running in my application.
Can some one tell me how to suspend execution of thread in threadproc
itself and then how to resume its execution.
Please help me.
Thanks in advance.

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<tr**************@yahoo.com> schrieb
Hi all
i am having problem in vb.net application.
I am having one thread which is currently running.
AFter executing some part of thread procedure i want to suspend
execution of thread and only after user has selected option
to resume execution then only i want to execute remaining part of
thread procedure.

Currently i am using suspend and resume method of thread. But my
problem is i am not sure whether in thread procedure itself
suspending thread is proper way or not.
Simiarly i am not sure whether to use suspend and resume or not.
Because i have so many threads running in my application.
Can some one tell me how to suspend execution of thread in
threadproc itself and then how to resume its execution.
Please help me.
Thanks in advance.


Waiting for a user to do some input is usually done by showing a Form
modally.

Armin

Nov 21 '05 #2

P: n/a
On 2005-06-25, tr**************@yahoo.com <tr**************@yahoo.com> wrote:
Hi all
i am having problem in vb.net application.
I am having one thread which is currently running.
AFter executing some part of thread procedure i want to suspend
execution of thread and only after user has selected option
to resume execution then only i want to execute remaining part of
thread procedure.

Currently i am using suspend and resume method of thread. But my
problem is i am not sure whether in thread procedure itself suspending
thread is proper way or not.
Simiarly i am not sure whether to use suspend and resume or not.
Because i have so many threads running in my application.
Can some one tell me how to suspend execution of thread in threadproc
itself and then how to resume its execution.
Please help me.
Thanks in advance.


You can have your worker threads wait on a AutoResetEvent or a
ManualReset event.

--
Tom Shelton [MVP]
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.