Basically, I need to tackle until some html appears on the web page. I created the following code for me: [/ p>
public void ExecuteBusyWaitThreads() { foreach (Canidate canidate in allCanidates) { Thread newThread = new Thread(delegate() { BusyWait(canidate); }); newThread.Start(); } } public bool BusyWait(Canidate canidate) {
So, if I had 8 canidates
, it would canidates
8 threads, each of which is looking for claim all
to display on the web page. found
is a global variable. As soon as one of the threads finds claim all
, all of them must fulfill the guarantee.
I have a couple of questions about this approach. Firstly, this is a good approach. Secondly, each thread will receive its own βcopyβ of the lively wait function. By this I mean whether one thread can supersede another and change the data in this function, or each of them gets a copy of the variables declared inside the function. Please note that both of these functions are inside the same object.
source share