MultiThreading

tonmoy

Member
Joined
Dec 2, 2004
Messages
6
Programming Experience
1-3
Hi

I want to make an application in VB.NET and I want this application to

work as follows, There will be an array of items on which I want to

perform a specific operation (MyTask), with the help of multiple

threads.

for example say the array is holding 12 items in it, and I want to

create 3 threads to do the work,

first therad reads the first item from the array and goes to perform

the specific operation (MyTask).

second thread reads the second item from the array and goes to perform

the MyTask

third thread reads the third itm from the array and goes to perform the

Mytask.

Now once the first thread completes the MyTask, I want to assign fourth

item from the array to the first thread to continue the process

once the second thread completes the MyTask, I want to assign the fifth

item from the array to the second thread and so on...

till, all the item from the array is processed.

How can I do this, Any help? Please provide me with the URL if any site

have any description about it.


Thanks

Tonmoy
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
i dont know how threading actually works, but here's a breif article on how it works:
http://www.codeproject.com/vb/net/threadingvbnet.asp

also:
instead of useing an array, use a Queue Collection
with a Queue you can add the tasks to the queue and whenever a thread complete's it's current task it'll grab the next task from the Queue (i just learned about this in my vb.net class yesterday)
 
Top Bottom