Re: Is there a way to make this work?
- From: Thijs Assies <thijs_a gmx net>
- To: Thijs Assies <thijs_a gmx net>
- Cc: Tristan Van Berkom <vantr touchtunes com>, GTK -app-devel <gtk-app-devel-list gnome org>
- Subject: Re: Is there a way to make this work?
- Date: Mon, 11 Nov 2002 19:49:44 +0100
Thijs Assies wrote:
Tristan Van Berkom wrote:
Hmm the age old problem ;)
I would add a thread to do the heavy stuff
and an IO channel for the child thread to comunicate
with the main GUI thread and update the clist with the data read in
the g_io_channel_add_watch callback.
But you could do a number of things. just remember
that only one thread is allowed to update the GUI.
-Tristan
Thijs Assies wrote:
Hi, i've created a program, wich gets an XML file and stores the stuff
into a clist. But when it gets the XML, and parses it. The program
freezes. I can solve this using fork. But i cant update the clist
within
a fork!
Is there a way to keep the program running while getting ad parsing
the XML?
thx.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
well: when i fork the get and parse code it works. But it starts
adding to the clist when the pasing isn't complete yet! how can you
allow a child to write to the gtk widget? Or do you have an example of
what you mean?
i created a thread wich get, parses the xml and updates the clist. But
it chrases, resulting in a zombie.
this is the code i used:
int timeout_handler(gpointer data)
{
void **child_stack;
child_stack = (void **)g_malloc(16500);
clone(timeout_handler2, child_stack, CLONE_VM, NULL);
return 1;
}
timeouthandler2 take care of the stuff i want. but the moment it
started, ps aux showes me a zombie. gdb cant debug it! how can i fix
this?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
I've red the API reference and i created this:
int timeout_handler(gpointer data)
{
GThread *thread1;
g_thread_init(NULL);
thread1 = g_thread_create
((GThreadFunc)timeout_handler2,
NULL,
NULL,
NULL);
return 1;
}
it workes, but the program still freezes when its busy!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]