26.06.2011, 07:55
I wanted to add that the AMX functions you are calling from outside the main thread have no concept of thread safety. It's very likely that a crash or some kind of undefined behavior will eventually occur when more than one thread attempts to modify the state of the virtual machine at the same time. This has been documented, and it is precisely why most multithreaded plugins now pass their shared data in a queue to the main loop (I've noticed that most people don't protect the queues with locking mechanisms, though, which can lead to just as many problems). Unfortunately, what you are trying to do just isn't possible without creating race conditions.