Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: threads & OCamlTK
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-03-17 (12:44)
From: Jun P. Furuse <Jun.Furuse@i...>
Subject: Re: threads & OCamlTK
Francois Rouaix wrote:

> > And, on a vaguely related topic, is it possible to use threads
> > with programs
> > that also use OCamlTK?  I know Tk is not threadsafe, but if only
> > one thread is calling Tk functions, then perhaps it's still OK?  
> Yes, it should be ok. But this also includes the Tk event loop, and thus
> all callbacks. Also, there is the issue of using Thread primitives within
> a callback (e.g. having the callback on a button triggering a condition).
> In bytecode threads, this will probably not work.
> Jun and I discussed these issues a long time ago, and Jun implemented
> a modified version of the CamlTK core where the event loop would be handled
> in Caml instead of C, so as to be compatible with threads, to some extent
> (all other Tk calls still need to be in a critical section).
> I don't think we ever distributed this version, and I'm not even sure it
> would work on Windows, but you might want to check with Jun.

I implemented this threaded version of OCamlTk, called ThreadTk about
one year ago. You can see the code at the caml cvs:

Please README.threadtk for more information.

But this is based on an old release of OCamlTk and not maintained at
all for long. I may update it if I have some spare time... 

Jun P. Furuse
    Institut National de Recherche en Informatique et en Automatique