473,394 Members | 1,702 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,394 software developers and data experts.

For Loop for Threading

Hello Everbody:
I have a question. How do you create a for loop for
Threads. I want to create 10 threads . I have created the
the code as follows:

for( tcpThd=1; tcpThd<=10; tcpThd++)
{tcpThd=new Thread(new ThreadStart(Process));
tcpThd.Priority=ThreadPriority.Highest;
tcpThd.Start();

}

But it does not work.

Pls guide..

THanks,

Kapil Shah
Nov 12 '05 #1
1 1153
for (int i=0; i < 10; i++) {
System.Threading.Thread t = new Thread(...);
t.Start();
}

But if you are not comfortable with for loops, I think you should be careful
about threads. . .

-D
"Kapil Shah" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
Hello Everbody:
I have a question. How do you create a for loop for
Threads. I want to create 10 threads . I have created the
the code as follows:

for( tcpThd=1; tcpThd<=10; tcpThd++)
{tcpThd=new Thread(new ThreadStart(Process));
tcpThd.Priority=ThreadPriority.Highest;
tcpThd.Start();

}

But it does not work.

Pls guide..

THanks,

Kapil Shah

Nov 12 '05 #2

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

Similar topics

3
by: Anand Pillai | last post by:
This is for folks who are familiar with asynchronous event handling in Python using the asyncore module. If you have ever used the asyncore module, you will realize that it's event loop does not...
8
by: Shamrokk | last post by:
My application has a loop that needs to run every 2 seconds or so. To acomplish this I used... "Thread.Sleep(2000);" When I run the program it runs fine. Once I press the button that starts the...
4
by: Nick | last post by:
Dear All, I have a section of code that is something along the lines of: private void threadFunc () { while (true) { object o = ourOwnQueueObject.GetObject (); // Non blocking....
8
by: kaiser | last post by:
Hello I am just starting to learn c# and am looking for help pls....I want run a loop until a user clicks a button that stops it...how do I do this?
8
by: Terry Olsen | last post by:
How do I loop back to the beginning of a for/next loop before getting to the end of it? Isn't there an "iterate" command or something like that? For Each This in That ...code if This = False...
1
by: robin | last post by:
hi, i'm a newbie, but please bear with me for a second. i have this function inside a while-loop, which i'd like to loop forever, but i'm not sure about how to change the parameters of my...
18
by: barry | last post by:
I'm having a problem creating a delay before each list item gets moved ( http://www.polisource.com/PublicMisc/list-splitter-timeout-bug.html ). Choose any number of columns, vertical layout, and...
13
by: Rick | last post by:
The following code will enter an infinate loop when in ReadChars. I can only make it happen when reading a Stream and with this particular XML. If I use the ReadInnerXml call rather than my own...
2
by: Kevin Walzer | last post by:
I'm trying to decide whether I need threads in my Tkinter application or not. My app is a front end to a command-line tool; it feeds commands to the command-line program, then reads its output and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.