O'Reilly logo

PowerBuilder® 9: Internet and Distributed Application Development by John D. Olson, Bill Green

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Thread Prioritization

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"

For example:

 // 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. // ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required