Threads & ProcExp (SysInternals)

Windows specific forum
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Threads & ProcExp (SysInternals)

Post by jassing »

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?
Last edited by jassing on Sat Jan 07, 2012 12:59 am, edited 1 time in total.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Threads & ProcExp (SysInternals)

Post by c4s »

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!
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: Threads & ProcExp (SysInternals)

Post by rsts »

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...
Twitter message?
cas
Enthusiast
Enthusiast
Posts: 597
Joined: Mon Nov 03, 2008 9:56 pm

Re: Threads & ProcExp (SysInternals)

Post by cas »

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
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: Threads & ProcExp (SysInternals)

Post by jassing »

Thanks.
Post Reply