Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-03

multi threading under Linux

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Anybody know how I can see the amount of threads running in a process under Linux? I don't mean programmatically in Free Pascal, I mean an external tool. Something like 'top' or 'ps aux' or Gnome System Monitor, etc..

I wrote a program the executes multiple threads to calculate CRC32 values on files. It verifies a CD-ROM against a list of previously calculated CRC values (from the master CD) to make sure the copied CD's has been written correctly.

Doing a 'ps aux' or using Gnome System Monitor, I can't see if those threads are actually running or the amount of threads running.

BTW, I'm trying to run a maximum of 10 threads at a time. This exercise is to see if dual core or qaud core processors can do crc checks against a CD-ROM faster than a single processor with a single thread.

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'
Jonas Maebe
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Anybody know how I can see the amount of threads running in a process under Linux? I don't mean programmatically in Free Pascal, I mean an external tool. Something like 'top' or 'ps aux' or Gnome System Monitor, etc..

Attach with gdb (gdb -p <pid>) and type "info threads"

Jonas

Henry Vermaak
to Graeme Geldenhuys: Anybody know how I can see the amount of threads running in a process under Linux? I…
Graeme Geldenhuys wrote 7 lines
Hi, Anybody know how I can see the amount of threads running in a process under Linux? I don't mean programmatically in Free Pascal, I mean an external tool. Something like 'top' or 'ps aux' or Gnome System Monitor, etc..

ps -eLf gives you information about threads. the NLWP (number of threads) and LWP (thread ID) columns are added with the -L option.

henry

Graeme Geldenhuys
to Henry Vermaak

Even easier, thanks.

G.

Henry Vermaak wrote
ps -eLf gives you information about threads. the NLWP (number of threads) and LWP (thread ID) columns are added with the -L option.
Marc PERTRON
to Henry Vermaak: ps -eLf gives you information about threads. the NLWP (number of threads) and LWP…
Henry Vermaak wrote 11 lines
On 23/03/07, Graeme Geldenhuys wrote: > Hi, > > Anybody know how I can see the amount of threads running in a process > under Linux? I don't mean programmatically in Free Pascal, I mean an > external tool. Something like 'top' or 'ps aux' or Gnome System > Monitor, etc.. > ps -eLf gives you information about threads. the NLWP (number of threads) and LWP (thread ID) columns are added with the -L option.

Hi,
There is also pstree (display a tree of processes)

Marc