[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1891.0. "To run AST's on the X EVENT QUEUE" by FREZEN::PROJECTS () Mon Dec 11 1989 14:27

	Hi,

	   Could you expand on the subject here? I'm wondering how many
	different ways I can run a group of AST's by synchronizing their
	execution on the X Event Queue.

	What is an X event?
	What events will the X queue act upon?
	Can I specify what kind of event the X queue can act upon?
	What about VMS... How can it play a role in the AST problem here?



	Much Appreciated
T.RTitleUserPersonal
Name
DateLines
1891.1startSDSVAX::SWEENEYThe Finite VoyageMon Dec 11 1989 17:379
    Although the documentation doesn't have much to say about it, calls to
    Xlib according to folklore are ast-reentrant.
    
    Whether this is accomplished by merely disabling/enabling ast's in some
    common routine, I do not know.
    
    If you have to ask "What is an X event" no satisfying answer can be
    entered into this conference. Instead go to the Scheiffler, Gettys,
    Newman book, The X Window System.
1891.2DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Tue Dec 12 1989 15:1413
Xlib is indeed ast reentrant.  Critical sections all turn off asts in a tricky,
but fast way.

What .0 may be asking about is the trick of porting an AST-driven program to
DECWindows by having the ast routines send messages using the X routine
SendEvent and then having the client reading events in user mode and dispatching
on them either to the appropriate X routine or to the routine which will act on
the receipt of an AST.

As .1 said, if you don't know what an X Event is, better get the Digital Press
book and come back with questions.

Burns
1891.3To run AST's on the X EVENT QUEUEFREZEN::PROJECTSTue Dec 12 1989 19:1713
	This is 0.

	I know what an X event is... what I want to do is take a group of
	routines attached to efn's and route them (synchronize their execution)
	thru the X event queue so they won't collide. All I have to do is
	mutually exclude one routine with any other events invoked from the
	mainloop. 

	I'm a little foggy on your statements on XLIB being reentrant...
	could you expand on that.

	I also saw a decwindows routine XtAddinput... have you used it at all?
1891.4SDSVAX::SWEENEYThe Finite VoyageWed Dec 13 1989 09:4017
    You appear to be confusing X and X Toolkit Intrinsics and this is at
    the root of your problem.
    
    The X event queue is a creature of X.  X defines only the XNextEvent
    and other event queue manipulation routines.
    
    The "mainloop" is a creature of X Toolkit Intrinsics (Xt routines).  It
    defines the _dispatch_ mechanism for each event.
    
    A common practice is to set a VMS event flag (and IOSB) inside an AST
    routine so that a non-AST routine will be dispatched through the main
    loop.
    
    Getting a VMS event flag (and IOSB) associated with this non-AST
    routine is what XtAppAddInput does.  Examples of the usage of this
    routine are in the EXAMPLES conference.
                                           
1891.5To run AST's on the X EVENT QUEUEFREZEN::PROJECTSWed Dec 13 1989 11:596

	Hi 	SDSVAX::SWEENEY "The Finite Voyage"


	   thankx
1891.6Since I just wrapped up a baselevel, I've got leisure time to pick nits...RTL::BUTENHOFBetter Living Through Concurrency!Tue Dec 19 1989 09:5515
.2: Being in a group that is HIGHLY concerned about re-entrancy (since we have
these wonderful little threads which we'd ideally like to see proceeding in
parallel), I just can never let statements like "Xlib is AST reentrant" slip by
without comment.  Xlib ISN'T reentrant.  Rather, it takes steps to prevent any
possibility of rentry!  T'ain't the same thing a'tall.  With ASTs, that's a
reasonable approximation, and often the only workable solution... but not all
parallel reentrancy is ASTs, and locking out other threads from the entire Xlib
library is probably NOT a reasonable approximation of reentrancy.

I know, I know... that's excess flamage, since you were just replying to a
question on ASTs.  Still... I don't want anyone to get complacent about this!
Threads are here, they'll be getting bigger and brighter, and I want everyone
coding libraries to start worrying!  :-)

	/dave
1891.7DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Wed Dec 20 1989 15:184
    re .6:  No problem...we all have our hot buttons.  Thanks for the
    clarification.
    
    Burns
1891.8Threads!OXNARD::HAYNESCharles HaynesThu Dec 21 1989 00:036
    Re: .6
    
    Hear! Hear! Now if I only had a LANGUAGE and an O/S that supported them...
    
    	... maybe next release!
    	-- Charles
1891.9QUARK::LIONELFree advice is worth every centThu Dec 21 1989 11:125
Re: .8

You do.  Ada (and LISP, I think) on VMS.

			Steve
1891.10Thanks for the (free) adviceOXNARD::HAYNESCharles HaynesSun Dec 24 1989 21:044
    Not to get into ADA (or VMS) bashing here. But ADA tasks ain't threads.
    I want better synchronization than rendezvous (among other things).
    
    	-- Charles