multithread
#1

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
Reply
#2

It's not removed, just locked.
Reply
#3

Don't use it.
Reply
#4

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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)