List Info

Thread: C-Sharp (C#) Group: The sin of Suspend()




C-Sharp (C#) Group: The sin of Suspend()
user name
2006-03-23 12:34:19
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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )