B
b.fokke
Hi all!
I'm working on an application that due to the nature of the application
is heavily concurrent. Usually, there will be between 15 and 20 threads
running at the same time. However, at some times it might be necessary
to pause execution of these threads. Thread.Suspend() looks like an
excellent candidate, but the method is deprecated in the framework.
According to the documentation I should use dedicated objects like
Monitors for synchronization.
I do understand why using Suspend() for synchronization is a Bad Idea
(TM). But is it a bad idea for pausing (parts of) an application as
well? There is no way of telling which part of the code each thread is
executing and I would hate to have to litter my code with checkPaused()
methods, or something like that.
Does anyone know whether it is a sin to use Suspend() in this case and
why or why not?
Thanks in advance,
Bram Fokke
the Netherlands
I'm working on an application that due to the nature of the application
is heavily concurrent. Usually, there will be between 15 and 20 threads
running at the same time. However, at some times it might be necessary
to pause execution of these threads. Thread.Suspend() looks like an
excellent candidate, but the method is deprecated in the framework.
According to the documentation I should use dedicated objects like
Monitors for synchronization.
I do understand why using Suspend() for synchronization is a Bad Idea
(TM). But is it a bad idea for pausing (parts of) an application as
well? There is no way of telling which part of the code each thread is
executing and I would hate to have to litter my code with checkPaused()
methods, or something like that.
Does anyone know whether it is a sin to use Suspend() in this case and
why or why not?
Thanks in advance,
Bram Fokke
the Netherlands