T
TS
ArrayList myCollection = new ArrayList();
foreach ( Object item in myCollection ) {
// code here.
}
Can someone explain how more than one thread would execute code? So if i
have some code in a web page that a user runs that iterates over an
arraylist, what is the scenario where more than one thread would be running
this code and could possibly modify the collection before the iteration of
the arraylist completes?
Since i instantiate myCollection (only one thread always runs the code for a
single request?) how would any other thread access myCollection?
thanks
foreach ( Object item in myCollection ) {
// code here.
}
Can someone explain how more than one thread would execute code? So if i
have some code in a web page that a user runs that iterates over an
arraylist, what is the scenario where more than one thread would be running
this code and could possibly modify the collection before the iteration of
the arraylist completes?
Since i instantiate myCollection (only one thread always runs the code for a
single request?) how would any other thread access myCollection?
thanks