|
Veteran Member
Join Date: Mar 2004
Location: Norway
|
05-04-2004
, 20:32
|
#4
|
well, When i was playing with my HLRally stats plugin. I got the idea that you could make some functions multithreaded. ( Not realy mulittread, but have this spesfic function run in another thread then the rest is.) I do assume that if a plugin is triggered everything it does when triggered will be done in 1 server frame. ( Ie if i do "amx_ban IDIOT" everything the plugin that handels this command has do to to finnish bannig will be done in 1 server frame. )
That way plugins that do "heavy" calulations can do this in a seperate thread(Sort of a low pri thread, that all plugins can send tasks to). When its not importent that the calculation is done "exacly" at a spesfic time.
If i continue with my HLR stats plugin example. The plugin depends heavly on catching events, and collects info. But when a player finnishes a lap, his time is compared up against a TopX list. This calculation does not realy need to be finnished in the same server frame that he crossed the Goal line, but it is somewhat CPU heave ( At least the most CPU heavy thing i never made ).
This is just a idea i got when playing around with it, dunno how easly it would be to impliment.
|
|
|
|