Re: Threading question (avoiding deadlock)
- From: G Hasse <gh raditex se>
- To: Pascal Haakmat <a haakmat chello nl>
- Cc: <gtk-list gnome org>, <gtk-app-devel-list gnome org>
- Subject: Re: Threading question (avoiding deadlock)
- Date: Sun, 17 Mar 2002 08:43:15 +0000 (GMT)
On Sun, 17 Mar 2002, Pascal Haakmat wrote:
Hello,
I was hoping somebody could point me in the right direction here.
I have a program with two (p)threads; one thread running the gtk_main()
event loop, and the other thread periodically updating the display in a
gdk_threads_enter() / gdk_threads_leave() block.
This tends to be an common question. The answer is
"Don't use threads at all". It is not nessecary.
Use a
gdk_input_add( fd, GDK_INPUT_READ, GTK_SIGNAL_FUNC(file_function),
&datastruct );
to get input from another filedescriptor and update your UI in
the "file_function". Threads will only make things complicated.
Göran
----------------------------------------------------------------
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]