Hi Gabor,<br><br><div class="gmail_quote">2010/6/27 Kiss Gabor (Bitman) <span dir="ltr">&lt;<a href="mailto:kissg@ssg.ki.iif.hu">kissg@ssg.ki.iif.hu</a>&gt;</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">&gt; &gt; I wonder if library routines (like dstate_*) are thread-safe?<br>
&gt;<br>
&gt; I can&#39;t speak for the other NUT developers, but I would prefer that we<br>
&gt; not open that can of worms.<br>
&gt;<br>
&gt; Most hardware can&#39;t handle multithreaded access without some sort of<br>
&gt; mutex, so I am not sure I see why the driver should be multithreaded.<br>
&gt;<br>
&gt; Can you explain a little more about this driver?<br>
<br>
</div>I can but I&#39;m afraid you won&#39;t be happy. :)<br>
<br>
I plan to write a version of &quot;clone&quot; 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 &quot;guru&quot;.)<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&#39; 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&#39;s opinion on multithread.<br>my personal one is moreover that you won&#39;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&#39; repeater mode.<br>
<br>btw, I do so now why you were eager to see the dummy-ups meta mode ;-)<br>Note that I&#39;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&amp;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>