If I look at a pb program running in ProcExp from sysinternals/microsoft, I can see thread information -- bu the thread ID in procexp does not match up with threadid() from PB -- I have a thread that is eating up a lot of cpu cycles... problem is that the threads depend on each other, so if I disable one thread, the other has nothing to do; so the cpu % drops...
any idea how to line up the process id and thread id with what the system reports as thread id's?
Threads & ProcExp (SysInternals)
Threads & ProcExp (SysInternals)
Last edited by jassing on Sat Jan 07, 2012 12:59 am, edited 1 time in total.
Re: Threads & ProcExp (SysInternals)
Yes and probably no. 
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Re: Threads & ProcExp (SysInternals)
Twitter message?jassing wrote:If I look at a pb program running in ProcExp from sysinternals/microsoft, I can see thread information -- bu the thread ID in procexp does not match up with threadid() from PB -- I have a thread that is eating up a lot of cpu cycles... problem is that the threads depend on each other, so if I disable one thread, the other has nothing to do; so the cpu % drops...
Re: Threads & ProcExp (SysInternals)
ThreadID() only returns handle, not ID. It is a bit misleading.
Code: Select all
Procedure work(void=0)
Debug "Thread ID:"+Str(GetCurrentThreadId_())
Repeat
Delay(1)
Until GetAsyncKeyState_(#VK_ESCAPE)
EndProcedure
Debug "Start Address: "+GetFilePart(ProgramFilename())+"+0x"+Hex(@work()-$400000)
thr=CreateThread(@work(),0)
If thr
Debug "Handle: "+Str(ThreadID(thr))
WaitThread(thr)
EndIf
