Re: Work woth GUI from a thread that was made by pthread_create function
- From: Michael Torrie <torriem cs byu edu>
- Cc: gtk-devel-list <gtk-devel-list gnome org>, gtk-app-devel-list gnome org, gnome-devel <gnome-devel-list gnome org>
- Subject: Re: Work woth GUI from a thread that was made by pthread_create function
- Date: 07 Feb 2002 15:09:03 -0700
That's a bit strong to say use heavy processes, not threads. The glib
and gdk functions do make it easy to attach handlers to i/o events,
which often eliminates the need for threads and child processes
altogether. However, GTK+ is thread-aware if you follow the guidelines
in the FAQ. One thread can only manipulate the GUI at a time (true on
windows or gtk). So you have to use special critical section blocks.
This has been covered quite a bit on this list(s), even in the last
week.
Michael
On Thu, 2002-02-07 at 16:41, G Hasse wrote:
> On 7 Feb 2002, jacob berkman wrote:
>
> > On Sat, 2002-02-02 at 07:32, admin kiesoft com wrote: > Hi! > > I'm
> > writing GNOME/GTK+ application for Linux that has a few work thread.
> > Each thread made by "pthread_create" function). When I try to access
> > GUI from child thread (thread that was made by main process) my app is
> > locked or dumped. What I have to do to be able wprk with GUI from a
> > thread that was made by "pthread_create"? > > Any help will be
> > appreciated!
>
> You should not use thread's in a gui-application. You should
> make separate processes and communicate whith them. Use
>
> gdk_input_add( fd, GDK_INPUT_READ, GTK_SIGNAL_FUNC(file_function),
> &cmd_info );
>
> to jump to a callback if there is some data on the file descriptor.
>
> GH
>
>
> ----------------------------------------------------------------
> Göran Hasse email: gh raditex se Tel: 08-6949270
> Raditex AB http://www.raditex.se
> Sickla Alle 7, 1tr Mob: 070-5530148
> 131 34 NACKA, SWEDEN
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
Public key available from http://students.cs.byu.edu/~torriem
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]