threading help

  • Thread starter Thread starter trialproduct2004
  • Start date Start date
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.
 
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
 
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.
 
Back
Top