From owner-freebsd-hackers Sun May 16 2:24: 0 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (Postfix) with ESMTP id 0727D1501B for ; Sun, 16 May 1999 02:23:55 -0700 (PDT) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.9.1/8.9.1) id TAA12519; Sun, 16 May 1999 19:36:35 +1000 (EST) (envelope-from jb) From: John Birrell Message-Id: <199905160936.TAA12519@cimlogic.com.au> Subject: Re: threads and Xlibs? In-Reply-To: <19990516014219.56752@hydrogen.nike.efn.org> from John-Mark Gurney at "May 16, 1999 1:42:19 am" To: gurney_j@resnet.uoregon.edu Date: Sun, 16 May 1999 19:36:35 +1000 (EST) Cc: jb@cimlogic.com.au, dlombardo@excite.com, hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG John-Mark Gurney wrote: > yes, but this is what compiling Xlib with threading support is suppose > to fix this so that you don't have problems... I haven't exactly looked > at what the threading support DOES for Xlib though, but I did manage > to make it so that XInitThreads() would return true, but I never did > get around to making more exhaustive tests... But it doesn't solve anything! I'm sorry, but this just sounds naiive to me. You need to understand how a threaded program intacts with an X server. I have built the X libraries with thread support and all I see is locking around accesses to the X server socket. You have no way to synchronise updates to widgets in your application from multiple threads. Unless you often Xflush the X connection and Xsync it, you end up with incomplete refreshes and events at odds with widget private states. If you don't believe me, try writing a threaded graphic animation program for factory process visualisation where refreshes must be exact. If you have more than one thread consuming X events, you will age quickly. If you have more than one thread updating widget states (remember that there is no thread model for widgets), you will happily die young. -- John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/ CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message