[collectd] I guess we need a config file

Niki Waibel niki.waibel at newlogic.com
Wed Dec 14 13:35:16 CET 2005


On 11-Dec-2005 Vincent Stehlé wrote:
> Florian Forster wrote:
>> So, alternatives for `glib' are:
>> - Threads
>>   o POSIX threads
>>   o `pth' (`GNU Portable Threads', haven't looked at it yet)
> 
> Hi,
> 
> Last time I looked, GNU pth were very portable, user-space, non-parallel 
> threads.
>   Probably not what you need here, especially if you want to allow SMP 
> machines to do real parallelism.

i think that gnu pth is what fits exactly.

gathering information of a system is never a matter of cpu speed.
it is more about how fast the kernel or disk reacts to the requests.
i think there is simply no need to spread the threads on cpus.

the advantage (in regard to collectd, imho) of the gnu pth is
that they are non-preemptive. another thread runs only
        a) if the program requests it
        b) if the running thread starts waiting for sthg
this has the advantage that the modules need not take care
of any concurrency. basically you can just leave them as
they are!!! no locking of curtime or any global var is
necessary.

preemptive threads (pthreads ie) run in parallel and a
scheduler can switch them anytime. i am sure that most
modules would need a rewrite then (introducing locking features
or calling functions instead of accessing variables).
also some system functions are not preemptive thread save,
but most of them are non-preemptive thread save.
(pls correct me if i am wrong here).

using pth you could just spread (in collectd's main loop)
the threads (request the execution) instead of running
them after each other. that's all. no rewrite -> big advantage
imho.

rds, niki





More information about the Collectd mailing list