HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Timer Elapse Question.

09-23-2010, 11:30 PM#1
syrathia
I have a question about Timers. When does a timers call back function get called in respect to other currently executing functions.

Lets say I have a LinkedList and I want to add a new item to it, but my timer has elapsed and is iterating through that list already.

Are timers and their call backs being handled in a seperate thread? If they aren't then this wouldn't be a problem. If so I'd have to add some sort of lock on the linked list to insure the integrity of its data. I looked around and couldn't find any info so some help would be appreciated.
09-24-2010, 03:14 AM#2
DioD
one thread at time.

if you already iterating list, no function will execute before you finished.

metadata for every list will solve problem.
09-24-2010, 03:41 AM#3
syrathia
Not sure what you mean by metadata for the list but thanks. Is there any case i need to worry about multi threaded programming because i recall reading somewhere about a thread per player or some such.
09-24-2010, 04:27 AM#4
Fledermaus
Nope, wc3 doesn't have any multi-threading.
09-24-2010, 04:27 AM#5
syrathia
Awesome thanks. Glad to hear that heh.