As a final note, I should mention the issue of thread prioritization. In EAServer (as of version 4.1.3), the developer has no means by which to control thread priority. To get around this limitation, we can call the Windows API to change the thread priority using the following functions:
function int SetThreadPriority(ulong hThreadHandle, long nPriority) library "Kernel32" function ulong GetCurrentThread() library "Kernel32" function int GetThreadPriority(ulong hThreadHandle) library "Kernel32"
// Get HANDLE for current thread. lul_threadhandle = getcurrentthread() // Lower thread priority to -1 (THREAD_PRIORITY_BELOW_NORMAL) li_ok = setthreadpriority(lul_threadhandle, -1 ) // Returns 1 if successful. // ...