Hi Gabor,<br><br><div class="gmail_quote">2010/6/27 Kiss Gabor (Bitman) <span dir="ltr"><<a href="mailto:kissg@ssg.ki.iif.hu">kissg@ssg.ki.iif.hu</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">> > I wonder if library routines (like dstate_*) are thread-safe?<br>
><br>
> I can't speak for the other NUT developers, but I would prefer that we<br>
> not open that can of worms.<br>
><br>
> Most hardware can't handle multithreaded access without some sort of<br>
> mutex, so I am not sure I see why the driver should be multithreaded.<br>
><br>
> Can you explain a little more about this driver?<br>
<br>
</div>I can but I'm afraid you won't be happy. :)<br>
<br>
I plan to write a version of "clone" that polls more than one<br>
physical UPS drivers. We have 4 UPS with parallel output<br>
and some 200 servers with several system administrators.<br>
(Some of them cannot be called "guru".)<br>
I want to offer a very simple, easy to use, single virtual<br>
ups that collect data from real drivers then calculates<br>
simulated values and offers a single status variable (OL/OB/LB)<br>
that my clients' upsmon. This is the only I can imagine<br>
that all of the is able to configure w/o any errors.<br>
<br>
OK, I can build a non threaded program too but it will be<br>
more complex a bit.<br clear="all"></blockquote></div><br>well, Charles already expressed most if not all the team's opinion on multithread.<br>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.<br>
serialized acquisition will get the job done, still in a portable (not only theoretically) way.<br>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.<br>
<br>btw, I do so now why you were eager to see the dummy-ups meta mode ;-)<br>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...<br><br>cheers,<br>
Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://www.eaton.com/mgeops">http://www.eaton.com/mgeops</a><br>Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/">http://www.networkupstools.org/</a><br>
Debian Developer - <a href="http://www.debian.org">http://www.debian.org</a><br>Free Software Developer - <a href="http://arnaud.quette.free.fr/">http://arnaud.quette.free.fr/</a><br><br>