[comp.windows.x] Toolkit re-entrant?

schoeller@kobal.enet.dec.com (Dick Schoeller) (06/29/90)

DECwindows is based on X11R3.  In X11R3 the toolkit has some major flaws
that prevent it from being used from multiple threads.  Under R4 most of
these problems are (supposedly) fixed.  I talked with Paul Asente about
this at the X Technical Conference.  His opinion was that it should work
but that it hadn't been tested for that purpose.  DECwindows will not
be based on R4 until sometime in the future.

Xlib under DECwindows is AST reentrant (it blocks ASTs during critical
sections) it is not thread reentrant.  So this adds additional difficulty.

This isn't much help, I know.  But it does let you know where you stand.

Dick Schoeller                  | schoeller@kobal.enet.dec.com
Digital Equipment Corporation   | 603-881-2965
110 Spit Brook Rd., ZKO2-3/R56  | "Either Judaism has something to say to the
Nashua, NH 03062-2642           | world or it has nothing to say to Jews."
                                |                             - Dennis Prager

thoth@springs.cis.ufl.edu (Gilligan) (07/08/90)

In article <4112@jato.Jpl.Nasa.Gov> kaleb@mars.jpl.nasa.gov (Kaleb Keithley) writes:

   Are Xt and Xaw re-entrant?  How about OpenLook or Motif?

   With more projects starting to use Ada, or SunOS 4.1 lightweight processes, 
   or even shared libraries between processes is this likely to be a problem?


  Funny someone should mention lightweight processes.  I've never
gotten them to work under SunOS.  Something about the non-blocking IO
library interferes with the non-blocking IO used in the Xlib.  I've
tried to mangle the source so that it doesn't use O_NDELAY but I've
only succeeded in causing it to print "Error: Can't open display" or
some such babble.
  If anyone can hack the Xlib to use regular IO then I may be able to
add threads to my applications.  The non-preemptive nature of sunlwp
should make it easy (for experienced programmers) to do multi-
threading, but if we can paste monitors around the Xlib and Xt then
we'll be much safer.
  I'd be much happier personally if xman could handle expose events
and scroll requests while it was formatting.
  I end up forking and letting a subprocess write to a pipe which I
XtAppAddInput to my application and handle piecemeil.  Someone PLEASE
patch Xlib.  XtAppAddWorkProc is NOT a solution.  Entirely too much
state information.

  THOTH out -=O=-
--
( My name's not really Gilligan, It's Robert Forsman, without an `e' )