[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-hardware-devel
Subject:    Re: [Kde-hardware-devel] PowerManager Library
From:       "Lamarque V. Souza" <lamarque () kde ! org>
Date:       2012-06-20 23:50:57
Message-ID: 201206202050.57415.lamarque () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Em Wednesday 20 June 2012, Daniel Nicoletti escreveu:
> 2012/6/20 Lamarque V. Souza <lamarque@kde.org>:
> > "Heavy work" is just a manner of speaking :-) It's too bad that each
> > module should implement such a thread way of doing things. We could add
> > something reusable like kded implementing each module as a thread. It
> > should work (famous last words).
> 
> I thought of that but it won't work, first because
> we don't know which module is thread-safe, secondly
> because there are a few modules which need to be in
> the main thread (such as colord-kde and krandr because
> they need to listen to X events). In the colord-kde case
> I moved just the "heavy work" (reading files) to a thread.
> My plan is to help each KDED developer to port their modules
> to use threads (which is very easy), but I didn't had time
> yet to start, KMix and NetworkManager which are the
> most verbose ones on the terminal would surely come
> first, but I need the maintainers willing to do the change...

	Networkmanagement's kded module uses KDialog to get the PIN/PUK codes to 
unlock Gsm modems, which means it also need to be in the main thread, at least 
that part have to be. Most of the kded initialization is done after the 
plasmoid is loaded (there is a signal for that), although I did not implement 
that for loading the module faster it also helps in this regard. My main 
concern is if something tries to access the module before it is fully up and 
running, hmmm if registering it to the bus is the last step that should do the 
trick (famous last words, part 2 :-)).

-- 
Lamarque V. Souza
KDE's Network Management maintainer
http://planetkde.org/pt-br

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" \
content="1" /><style type="text/css"> p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Tahoma'; font-size:12pt; font-weight:400; \
font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Em \
Wednesday 20 June 2012, Daniel Nicoletti escreveu:</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; 2012/6/20 Lamarque V. Souza \
&lt;lamarque@kde.org&gt;:</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; &gt; &quot;Heavy work&quot; is just a manner of speaking :-) \
It's too bad that each</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; &gt; module should implement such a thread way of doing \
things. We could add</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; &gt; something reusable like kded implementing each module as \
a thread. It</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; &gt; \
should work (famous last words).</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; I thought of that but it won't work, first because</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; we don't know which \
module is thread-safe, secondly</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; because there are a few modules which need to be in</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; the main thread (such as \
colord-kde and krandr because</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">&gt; they need to listen to X events). In the colord-kde case</p> \
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; I moved just the \
&quot;heavy work&quot; (reading files) to a thread.</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; My plan is to help each KDED developer to \
port their modules</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; to use \
threads (which is very easy), but I didn't had time</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; yet to start, KMix and NetworkManager which \
are the</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt; most \
verbose ones on the terminal would surely come</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">&gt; first, but I need the maintainers willing to \
do the change...</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; ">&nbsp;</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">	Networkmanagement's kded module uses KDialog to get the PIN/PUK \
codes to unlock Gsm modems, which means it also need to be in the main thread, at \
least that part have to be. Most of the kded initialization is done after the \
plasmoid is loaded (there is a signal for that), although I did not implement that \
for loading the module faster it also helps in this regard. My main concern is if \
something tries to access the module before it is fully up and running, hmmm if \
registering it to the bus is the last step that should do the trick (famous last \
words, part 2 :-)).</p> <p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; ">&nbsp;</p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">-- </p> <p style=" margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">Lamarque V. Souza</p> <p style=" margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;">KDE's Network Management maintainer</p> <p \
style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;">http://planetkde.org/pt-br</p></body></html>



_______________________________________________
Kde-hardware-devel mailing list
Kde-hardware-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-hardware-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic