AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Multi-threading (https://forums.alliedmods.net/showthread.php?t=1686)

Li0n 05-04-2004 18:02

Multi-threading
 
and what about a real bug-free multi-threading module ? (unlike the amxmod module)

EKS 05-04-2004 19:52

Id like a module that lowers CPU load & makes me food to!!!!

BAILOPAN 05-04-2004 20:02

while instaneous food distribution (IFD) is being worked on, sadly AMXx is not threading safe.

I will not make a threading module for one reason: programmers don't know how to use it properly. When I first tried it, I did not know AMX was not threading safe and my apps crashed.

I will try to make multithreading callback based modules that are isolated - for specific purposes. Multithreading mysql, sockets, etc... but not a module for "do anything in a thread".

EKS 05-04-2004 20:32

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.

BAILOPAN 05-04-2004 20:55

it doesn't matter, the point is executing threaded functions is not safe in the amxx core with any native that uses strings.

EKS 05-04-2004 21:16

ok, to bad. Is it planned for any upcomming release ? Or to much rewrite required to make it work?

BAILOPAN 05-04-2004 21:28

making amxx threading safe would be a very very difficult task. It's not feasible right now. the best idea is to make modules which are isolated in their own threading mechanisms


All times are GMT -4. The time now is 03:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.