multithread - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Other (
https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (
https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: multithread (
/showthread.php?tid=582652)
multithread -
jamesbond007 - 22.07.2015
why was the multithread by fro1sha topic removed from plugins? lol just curious :/ could have locked it or smthng.
i just wanted to view source code and read comments why it wont work.. nvm i guess
https://sampforum.blast.hk/showthread.php?tid=264178
Re: multithread -
Smithy - 22.07.2015
It's not removed, just locked.
Re: multithread -
rymax99 - 22.07.2015
Don't use it.
Re: multithread -
Mauzen - 22.07.2015
Here it is:
https://sampforum.blast.hk/showthread.php?tid=264178
The problem with multithreading is the same as always. Pawn isnt designed to allow syncing for multiple threads. Even something like GetPlayerPos in a thread, called while another native is executed, can cause memory corruptio. This can have pretty much any imaginable effect, ranging from no effect at all, over a server crash, to strange behaviour or even corrputed save data.
This is a deeply technical thing. Even if it works for a year without any problems its no guarantee that it wont crash horribly tomorrow. Best thing is to completely avoid using it, or, if you really need threads, to use tick synchronized threads in a plugin (like the streamer does), or plugin threads that do not use pawn functions at all, so they do not interfere with the pawn thread (e.g. for anytime algorithms).