[Nut-upsdev] Threads

Arnaud Quette aquette.dev at gmail.com
Mon Jun 28 11:46:01 UTC 2010

Hi Gabor,

2010/6/27 Kiss Gabor (Bitman) <kissg at ssg.ki.iif.hu>

> > > I wonder if library routines (like dstate_*) are thread-safe?
> >
> > I can't speak for the other NUT developers, but I would prefer that we
> > not open that can of worms.
> >
> > Most hardware can't handle multithreaded access without some sort of
> > mutex, so I am not sure I see why the driver should be multithreaded.
> >
> > Can you explain a little more about this driver?
> I can but I'm afraid you won't be happy. :)
> I plan to write a version of "clone" that polls more than one
> physical UPS drivers. We have 4 UPS with parallel output
> and some 200 servers with several system administrators.
> (Some of them cannot be called "guru".)
> I want to offer a very simple, easy to use, single virtual
> ups that collect data from real drivers then calculates
> simulated values and offers a single status variable (OL/OB/LB)
> that my clients' upsmon. This is the only I can imagine
> that all of the is able to configure w/o any errors.
> OK, I can build a non threaded program too but it will be
> more complex a bit.

well, Charles already expressed most if not all the team's opinion on
my personal one is moreover that you won't gain simplicity by adding
multithread support for such case, since you will need to sync your thread
and core for data consolidation.
serialized acquisition will get the job done, still in a portable (not only
theoretically) way.
if you really want to split the acquisition load, use 4 real drivers, and
then acquire data from the local sockets. Somehow like the clone driver do.
Or using the network protocol (through upsd) like dummy-ups' repeater mode.

btw, I do so now why you were eager to see the dummy-ups meta mode ;-)
Note that I'm still interested in working on this, but simply lacking time
to do so. But we can work together if you like...

Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20100628/d73fde50/attachment.htm>

More information about the Nut-upsdev mailing list