Re: 'hacking' some of XFCE goodies

Ondrej Mihalyi <[email protected]>
Newsgroups gmane.comp.desktop.xfce.goodies.devel
Organization MFF UK Praha
Message-ID <20050917161708.00005edf@ACER_ONDRA>
Didn't try your app, but I think that it would help, if instead of system() you would use combination of fork(), exec() and waitpid().  Idea is to use fork and exec to spawn the 'top' process and then periodically use non-blocking version of waitpid (there are some flags to make it non-blocking) to check whether the 'top' process finished.

I know that you may well not be familiar with those functions, but if you want to succeed in making your app better, I believe that this is kind of easy way how to do it.

Cheers, 

Ondrej

On Fri, 16 Sep 2005 12:08:41 +0200
_ukasz Hejnak <[email protected]> wrote:

> Hi again :]
> Ok, just to finish the cpugraph-szifted panel-crashing issue
> As I saw 'some' interest in my modification of cpugraph,
> I decided to finally learn some more on C and finish the crashing
> As reading trough I found out about the system() function ;]
> So now I use that instead of the funny 'script' system
> And as system() waits for the runned process to finish up, it won't give 
> the cpugraph any more reasons to crash also..
> 
> The only issue now, is that as it waits for the system() to finish up, 
> the whole panel freezes for a nano-second (when top works)..
> I think only a alternate system of getting the data would solve this one
> but I don't have time to go into this right now, maybe in the future.
> 
> So all it depends on now is a /tmp dir writable to the user, and the 
> /usr/bin/top program installed.
> The updated version is already available at the standard location:
> http://szift.org/xfce/xfce4-cpugraph-plugin-szifted.tar.bz2
> 
> Have fun :]
> Should there anything other wrong happen, please let me know.
> 
> -- 
> Best wishes
> _ukasz Hejnak
> 
> _______________________________________________
> xfce-goodies-dev mailing list
> [email protected]
> http://lists.berlios.de/mailman/listinfo/xfce-goodies-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.