Re: Why not to split gmc and other gnome applications into threads?



Martin Oberzalek wrote:
> 
> On Sun, 7 Nov 1999, Antonio Campos wrote:
> 
> > This is something people would find very attractive in GNOME and GMC in
> > particular...
> > The other day I was using GMC and when I pressed on a big tgz archive
> > for looking into it, GMC because responseless because it wasn't able to
> > redraw itself. Even more, it wasn't able to redraw the icons on the
> > desktop (because the icons depends on GMC and GMC was opening the big
> > tgz file)...
> > So it could be nice (like I think it's in Windows) that GMC and other
> > GNOME (even GTK) applications split themselves into threads. So for
> > example GMC could have a thread to redraw the icons on the desktop each
> > 5 seconds or so, another thread could redraw the tree of directories on
> > the left and other to redraw the icons of files on the right.
> > Even more nice would be to make these threads callable for every GNOME
> > application, so that every application could have a little GMC into
> > itself if it needed it.
> 
> It's more difficult than in windows to make a simple thread, because when
> you call the fork command, you create a new process. So you have to chose
> a pipe ore something like this to communicate with the other thread.
> But this is only an explanation and no excusion.

You don't have to fork - use a pthread_create call to create a real
thread. Threads can share memory, and you can use simple mutexes to
protect important resources.

-- 
Colin Fox
cfox@telus.net
http://overkill.starnetc.com/~cfox



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]