473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to manage threads?


Hi,

I have 4 classes(of different type) which each of them span a thread
and i would like to run the thread sequentially(for debug)
in such that the second thread will start only after the
first thread finished

what is the best way to achive it,assuming i would like to be able
to stop the thread after it was started
Thanks in advance

Nov 17 '05 #1
1 2923
TOMERDR <to*****@hotmail.com> wrote:
I have 4 classes(of different type) which each of them span a thread
and i would like to run the thread sequentially(for debug)
in such that the second thread will start only after the
first thread finished

what is the best way to achive it,assuming i would like to be able
to stop the thread after it was started


It's not entirely clear what you mean, but there are two issues here:

1) Running four tasks in sequence
2) Stopping a thread

The second point I've written about here:
http://www.pobox.com/~skeet/csharp/t...shutdown.shtml

For the first point, it would help if you'd give some more detail. Are
you actually creating four threads? If so, do you have to, or could you
just run a single thread which calls the four different
ThreadStart-comptaible methods in turn?

If you really are starting four threads and feel you have to, you could
make each thread call Join on the "previous" one, which should have
roughly the same effect.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronan Viernes | last post by:
Hi, I have created a python script (see below) to count the maximum number of threads per process (by starting new threads continuously until it breaks). ###### #testThread.py import...
1
by: GianGuz | last post by:
In the following example Global is able to create and manage access to objects of any kind (even in a multithreading environment) with and index value attached to. So a Global<0, string> is a...
0
by: wh | last post by:
The application that I'm about to start working on requires maintaining a list of users currently accessing an asp.net application running on IIS5.0. I essentially need to monitor which xml files...
1
by: Raoul Minder | last post by:
Hi all I am new to threading! I am developping a newsletter tool including a dispatch manager that should schedule sendings. The Web layer kicks a remote object hosted by a windows service...
10
by: Darian | last post by:
Is there a way to find all the thread names that are running in a project? For example, if I have 5 threads T1, T2, T3, T4, T5...and T2, T4, and T5 are running...I want to be able to know that...
8
by: Manfred Braun | last post by:
Hello All! I am writing a management application, which has to access remote machines registry via System.Diagnostics.EventLog.CreateEventSource . For each machine, I connect to, I create a...
4
by: billie | last post by:
Hi all. I'm (re)writing an FTP server application by using asyncore/asynchat modules. FTP tipically got two different channels: command and data. I'm succesfully managing command channel through...
3
by: Tony Adamoli | last post by:
Can someone tell me how to install ImageMagic on a Windows 2003 Small Business Server running PHP 5.2.5 and IIS 6.0? This has been driving me crazy for days. I have downloaded php_imagick.dll...
1
by: matthewaveryusa | last post by:
I have a timer T that launches an event on each tick: void t_Tick(object sender, EventArgs e) { System.Threading.Thread TickThread = new...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.