[collectd] Threads, pthreads, pth, ...

Niki W. Waibel niki.waibel at newlogic.com
Sat Dec 17 05:34:03 CET 2005


On Fri, Dec 16, 2005 at 09:50:16PM +0100, Florian Forster wrote:
> On Fri, Dec 16, 2005 at 05:04:11PM +0100, Niki Waibel wrote:
> 
> > > That means that if one
> > > thread is waiting the process is waiting. And that would mean that all
> > > threads are "waiting"..
> > 
> > no. that is the thing *all* threading implemmentations handle.  (pth
> > does that by overwriting the read/write/etc calls via its header
> > file).
> 
> Okay, this explains a lot; you've convinced me that it would work.
> Though I now think this is a dirty hack.. ;) That doesn't work with
> libraries you link against, does it?

it is possible. read section SYSTEM CALL WRAPPER FACILITY of man pth.

> > i'd recommend you to read
> >         man pth
> > it explains almost everything.
> 
> I've read <http://www.gnu.org/software/pth/pth-manual.html> which was
> very general and didn't talk about how `pth' actually works. The manpage
> is only a groff-version of the same text..

?
imho it explains pretty detailed what pth does...

> > the concepts / akademic books talk a lot about the kernel implementation.
> > if you have a N->N a N->1 or a N->M model.
> > pth does not need any of them. compleatly in userspace by overwriting
> > (via define) some functions.
> 
> What's the difference between a `N->1' model and a thread library
> completely in userland?

it does not use the kernel, so it is much more portable:
  Pth was successfully tested on FreeBSD, NetBSD, OpenBSD, BSDI,
  GNU/Linux, Solaris, HPUX, Tru64 (OSF/1), AIX, IRIX, UnixWare, SCO
  OpenServer, SINIX, ReliantUNIX, ISC, AmigaOS, Rhapsody (MacOS X), FTX,
  AUX and Win32/Cygwin. And it should should automatically adjust itself
  to remaining Unix platforms, too.




More information about the Collectd mailing list