And so I decided to make a multithreaded application :'(
I am new to multiple threads - so my problem is this...
1 Array of lets say 100 strings
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...
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.
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=-