DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th February 2011
PvSw1 PvSw1 is offline
New User
 
Join Date: Feb 2011
Posts: 3
Thanked 0 Times in 0 Posts
Default OpenBSD, how to see subprocess details

Hi all,

I am a happy user of OpenBSD. Currently I have some problems I am trying to debug.
I have a program that runs a few 'subprocesses' (threads?). Looking with 'ps waux' I can see the main program STAT="Ss".
Can anyone tell me which utilities / options can be used to see each of the individual subprocesses?

Remark: The top -T options seems related. However I do not see any difference at all between "top -T" and "top", so I have no processes at all with threads, the -T option does not work or it has other purposes.
Reply With Quote
  #2   (View Single Post)  
Old 7th February 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

For threads, there really isn't true native support for that.. at least in the sense the kernel isn't aware of userland threads yet.

As for child processes, the PPID (..parent PID) will be set.. it's added to the output if ps(1) with the -l/-j arguments.
Reply With Quote
  #3   (View Single Post)  
Old 7th February 2011
PvSw1 PvSw1 is offline
New User
 
Join Date: Feb 2011
Posts: 3
Thanked 0 Times in 0 Posts
Default

Hi there,

No native kernel support for threads. That would explain why I could not find anything. But I am relatively sure threading is used and does work. Does this mean that scheduling of threads is done by the main program itself (I mean through some clever library that keeps the main program and all the threads running)?
Reply With Quote
  #4   (View Single Post)  
Old 7th February 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

The pthreads library has all the logic for handling threads, some work is underway for kernel-aware (1:1) userland threads (..rthreads, in OpenBSD context) but they're not ready for general consumption yet.

I believe what OpenBSD does would be called the N:1 model.
Reply With Quote
  #5   (View Single Post)  
Old 7th February 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

A lot of people don't agree with the concept of "threads" preferring the traditional process (exec/fork) based method, perhaps with IPC and a well designed protocol.

For example, people using PostgreSQL notice better performance than those who use MySQL (..which is threaded).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:15 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick