mail-archives/gtk-sharp-list/2004-July/004493.html

83 строки
3.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Multi-threading and GTK#
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:draek%40shaw.ca">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="004510.html">
<LINK REL="Next" HREF="004496.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Multi-threading and GTK#
</H1>
<B>Phil Durand
</B>
<A HREF="mailto:draek%40shaw.ca"
TITLE="[Gtk-sharp-list] Multi-threading and GTK#">draek@shaw.ca
</A><BR>
<I>Mon, 19 Jul 2004 16:46:12 -0600</I>
<P><UL>
<LI> Previous message: <A HREF="004510.html">[Gtk-sharp-list] g_get_home_dir
</A></li>
<LI> Next message: <A HREF="004496.html">[Gtk-sharp-list] Multi-threading and GTK#
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4493">[ date ]</a>
<a href="thread.html#4493">[ thread ]</a>
<a href="subject.html#4493">[ subject ]</a>
<a href="author.html#4493">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>I know this topic has been spoken about before, but I wanted to start
off by getting clarification of Gdk.Threads.
Our application has two parts, a library and a GTK# app. The library
uses System.Net to work with socket connections to a server. It obtains
its information through the use of timers and threads to provide a
non-blocking interface (we find that async io is not working correctly
in mono, so we have reverted to using this method, besides, we already
use timer threads so we dont evade threads by using async io)
Now, so far, I have been using Gdk.Threads.Init(); at the start of my
program, and Gdk.Threads.Enter() and Leave() between code blocks that
modify things in the UI to keep it thread safe. However, I am now at an
impass where the whole GTK# interface freezes when trying to modify a
TextView. I am assuming that I am experiencing a GTK# problem because of
threading.
Is Gdk.Threads.Enter/Leave() a solution to the threading issues with
GTK? or is it that I've just gotten lucky so far and Enter/Leave dont
actually do anything?
I've had lots of discussions about how to do multi-threading GTK# and to
be honest, I havent really come up with any good solutions other than
Enter/Leave from Gdk.Threads. Any information on this topic would be
greatly appreciated.
Thank you,
Phil Durand
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="004510.html">[Gtk-sharp-list] g_get_home_dir
</A></li>
<LI> Next message: <A HREF="004496.html">[Gtk-sharp-list] Multi-threading and GTK#
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4493">[ date ]</a>
<a href="thread.html#4493">[ thread ]</a>
<a href="subject.html#4493">[ subject ]</a>
<a href="author.html#4493">[ author ]</a>
</LI>
</UL>
</body></html>