If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Multithreading DotNet4 & VB2010

How do I make the 4 threads access the same array - also, once one string has been used(read) - it will be removed by a function that I have written already.

So the problem I'm experiencing is that when the 1st thread removes the string from the array at that specific stage the 3rd might be accessing the array and the string returned from the array = nothing...

Re: Multithreading DotNet4 & VB2010

Right - thank you for pointing out those points

The array is used as a hyperlink collector - I'm writing a kind of spider for research and what needs to be done is as follow.

The array contains hyperlinks, it needs to be sorted which is easy through Array.Sort(Array)
Then the douples needs to be removed - also easy by using Array.BinarySearch(Array, Value)
Then removing the entry, I have written a function to do that.

So now the problem - testing the link and removing it when there is success and inserting it to another array.
This is where the multiple threads come in.

Processing time depends on response time.

Not so much CPU intensive, if list was larger yes... Not at the moment.

Re: Multithreading DotNet4 & VB2010

Hehe, ye I can understand why you do that
So no spider code here

I did think of splitting the array into four - though the coding complexity increases.
The second bool array is an idea - will try it for a test.
The prefix idea - almost the same as the bool idea, but at least one array less... Also will try

Thanks for the ideas - it was staring me right in the face -=facepalm=-