In my case I've got a game server, with the CLR threadpool handling the sockets, and a managed threadpool for the other stuff. I'm trying to figure out what the best way to handle events like, an npc casting a spell, or despawning after a set period is.
I could just write some sort of Timer wrapper that gets a new (managed)threadpool thread for each action I want to perform, like new TimedEvent(1500, npc.Cast(Spells.FireBall)); and have it check against the system time, but, I think, with multiple timers like that running, each individually checking the elapsed time is inefficient. Would some sort of dispatcher thread be better?
Thanks in advance.