From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!cernvax!cui!bertrand From: bertrand@cui.unige.ch (IBRAHIM Bertrand) Newsgroups: comp.lang.ada Subject: query: multi-threaded use of X by Ada tasks Message-ID: <479@cui.unige.ch> Date: 2 May 89 16:08:13 GMT Reply-To: bertrand@cui.UUCP (IBRAHIM Bertrand) Organization: University of Geneva, Switzerland List-Id: I am working on a computer aided learning project at the University of Geneva using the X-windows Xray toolkit with an Ada interface on a SUN 3/60 workstation. I'm having a problem with multi-threaded access to the toolkit and low-level X windows primitives. My Ada program has several tasks which call into the Ada interface to Xrlib which, in turn, calls the toolkit's C routines. Everything worked fine until I put a call to XGet_Geometry() into one of the tasks. This caused the window manager to hang and anonymous run-time error to appear: "sequence lost." I could make everything fine again by embedding the XGet_Geometry() call inside an Ada "rendezvous", thus suspending the other tasks for the duration of the call. I could also make it work by surrounding all toolkit calls with "Wait" and "Signal" calls to a semaphore task, thus confirming that the toolkit won't support multi-threaded access. The C code for each X Windows primitive locks and unlocks the display with the macros "LockDisplay" and "UnlockDisplay" which, in my copy of the X Windows source, are empty macros which do nothing. The manual says that these macros can be defined for systems which want to support multi-threaded access. My question is how can I make the Xray toolkit and the low-level X Windows primitives support multi-threaded access? How are "LockDisplay" and "UnlockDisplay" supposed to be implemented? (The C code can't possibly know about Ada tasks.) Is there anyone else using the Ada interface who has encountered this problem? I would appreciate any suggestions or comments. I am using X11R2 on a Sun 3/60 running SUNOS3.5. The release of the Xray toolkit is the one that arrived with the X11R2 tapes. Thanks for any help. Bertrand Ibrahim to BITNET to MHS from BITNET IBRAHIM@CGEUGE51 ibrahim@uni2a.unige.ch INTERNET IBRAHIM%CGEUGE51@CUNYVM.CUNY.EDU ibrahim%uni2a.unige.ch@ubc.csnet MHS ibrahim@uni2a.unige.ch JANET ibrahim%uni2a.unige.ch@uk.ac.ean-relay from UUCP to UUCP : cernvax!cui!bertrand.uucp mcvax!cernvax!cui!bertrand.uucp cui!bertrand@cernvax.UUCP