caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@ozemail.com.au>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Daniel Ortmann <ortmann@us.ibm.com>, caml-list@inria.fr
Subject: Re: OCaml's long range graphical direction?
Date: Wed, 07 Feb 2001 11:39:25 +1100	[thread overview]
Message-ID: <3A80993D.1E4F8295@ozemail.com.au> (raw)
In-Reply-To: <20010206102842.A27059@pauillac.inria.fr>

Xavier Leroy wrote:
> 
> > Xavier,
> > Please speculate on the future development direction of graphical support
> > in OCaml.

> > To what degree does threading affect the answer?
> 
> No idea.  I've heard plenty of claims that multithreading helps
> building good GUIs (see e.g. BeOS), yet most popular GUIs (including
> TK and I think GTK too) seem to manage fine without multithreading.

	No. Tk is not re-entrant/thread-safe and never will be.
(I'm paraphrasing Ousterhout's own claim).

	When 'normal' functions are called, one can always use a 
global lock to get around this problem, but this is not the case
for a GUI like Tk, which takes control of the system and
invokes user code _entirely_ using callbacks. When another
thread also invokes the Tk mainloop, all hell breaks loose,
since state data is held in static storage. It does no
good to use a lock, since the first thread never regains
control, and so the second will be excluded permanently.

	As far as I know, GTK has been built with an eye
to making it multi-threadable .. later (that is, it suffers
the same problem as Tk at present). MS-Windows is miles ahead here.

	One 'solution' to this problem is to have a single
'GUI' server thread, and have all client threads 'post'
to that server. Server callbacks can use locking to update
shared locations.  Unfortunately, this requires construction
of a complete client-side binding of the API to create a queue
of service requests, and a server side binding to pick them
up from within the event dispatch loop during idle time
and process them. [And event handling is event harder ... ]

	Note that Tcl (8.xx) is multi-threadable, since state
data can be captured in interpreter objects, of which there
can be many (at least one per thread ..).

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net



  parent reply	other threads:[~2001-02-07 21:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-05 17:48 Daniel Ortmann
2001-02-06  9:28 ` Xavier Leroy
2001-02-06 18:19   ` Sven LUTHER
2001-02-07 21:30     ` Pierre Weis
2001-02-08  7:32       ` Sven
2001-02-08  1:59     ` Jacques Garrigue
2001-02-08  7:55       ` Sven
2001-02-09  8:47         ` Claudio Sacerdoti Coen
2001-02-09 10:00           ` Sven LUTHER
2001-02-08 20:35       ` Brian Rogoff
2001-02-09  1:28         ` Jacques Garrigue
2001-02-09 18:11           ` Brian Rogoff
2001-02-10 13:01             ` Jacques Garrigue
2001-02-09 20:01           ` Marcin 'Qrczak' Kowalczyk
2001-02-12 14:52             ` Nicolas barnier
2001-02-12 23:47               ` Jacques Garrigue
2001-02-15 12:21                 ` [Caml-list] " Sven LUTHER
2001-02-08 10:28     ` Alan Schmitt
2001-02-09  1:24       ` bcpierce
2001-02-06 20:30   ` Dale Arntson
2001-02-07  0:39   ` John Max Skaller [this message]
2001-02-08 20:01   ` Francois Rouaix
2001-02-09  9:41     ` Sven LUTHER
2001-02-09  9:49     ` Jacques Garrigue
2001-02-09 19:58       ` Jerome Vouillon
2001-02-10 12:36         ` Jacques Garrigue
2001-02-10 21:25         ` Pierre Weis
2001-02-09 17:50     ` John Max Skaller
2001-02-06 19:33 Maxence
2001-02-09 23:31 Arturo Borquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A80993D.1E4F8295@ozemail.com.au \
    --to=skaller@ozemail.com.au \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=ortmann@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).