Creating threads
I'm trying to make a sourcemod extension to create a thread to execute any given plugin function with the simple code:
Code:
DWORD WINAPI thr(LPVOID param) I'm not sure why the code I wrote causes this erratic behavior. Any help? |
Re: Creating threads
|
Re: Creating threads
ipluginfunction::callfunction() isn't threadsafe?
|
Re: Creating threads
The SP runtime is only ever expected to operate on the game's main thread.
You should not be calling into or out of SP from another thread unless you're serializing access between your threads, which can defeat the purpose of having a separate thread in the first place. If you're doing some expensive operations that you want to move to another thread, a generic producer/consumer pattern is used where you can hook GameFrame to see if any of your queued jobs are completed/failed/etc. |
Re: Creating threads
ok, guess it's not possible, thx~
|
All times are GMT -4. The time now is 01:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.