threading help

T

trialproduct2004

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.
 
A

Armin Zingler

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
 
T

Tom Shelton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top