[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

90.0. "Application with multiple clients- multi-threaded?" by MQOP12::P_BOURASSA (Pierre ...� Montr�al) Wed Feb 01 1989 08:14

A customer of mine wants to develop a DECwindows application where
the application client will run on a VAXcluster (2 * 8530) and the
display servers will be COMPAQ 286 (about 100 PC's).
Because of the large number of clients, we would like to run the
application in a multi-thread fashion to save ressources.  Is it
possible to have a single process on the VAX handle multiple
clients in a single application?  If yes, how can it be done.  If
it is not possible, how much memory overhead is required for each
process running a DECwindows application.

The application will work in 2 windows.  One will just be used to display
information which is received in real-time by the application.  The
second window will be used to accept user interaction through the normal
processing of widgets.  Any ideas on how to do this?

Thanks,

Pierre (novice on DECwindows...)

T.RTitleUserPersonal
Name
DateLines
90.1PSW::WINALSKIPaul S. WinalskiWed Feb 01 1989 12:4010
The only restriction that DECwindows imposes on a multi-threaded client
application is that you can't do Xtoolkit or DWT calls from AST level.  If
you have code running at AST level that wishes to do toolkit calls, it can
put application-defined events on the X event queue to cause the mainline
code to do the window stuff.  Aside from that, there is no difference between
writing a DECwindows multi-thread application and writing any other sort of
multi-thread application.

--PSW

90.2Are we talking about ADA or Common Multithread Architecture type threads here?DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Thu Feb 02 1989 13:1810
It sounds to me like you were talking more about Ada-style multi-threads; rather
than multiple active AST levels.  In this case, I think the main problem you
will find is that for now you can't call XTInitialize more than once per
real process.  Thus if you have multiple threads within a single process which
are creating separate display connections, etc, you will be in trouble, since
presumably each tk application will call XtInitialize.  This should be fixed
in VMS V5.2.

Burns

90.3PSW::WINALSKIPaul S. WinalskiThu Feb 02 1989 14:029
RE: .2

The problems with Ada-style multithreading and AST-based multithreading are
the same.  The stumbling block is that the toolkit isn't reentrant.  In an
Ada tasking environment, everything works just fine if you do all toolkit
calls from one task only.

--PSW

90.4Any plans to improve the situation?PULMAN::MACKEmbrace No ContradictionsThu Feb 02 1989 18:0217
-  Are there any plans to make the toolkit reentrant?  

-  Is our X implementation itself reentrant?  (I know hardware resources like 
   color tables are a sore spot in attempting reentrancy...)

-  Are there any plans to make a major piece of the toolkit reentrant in a way 
   that would reduce in a meaningful way the amount of UI code that would have 
   to be serialized?  

I know reentrant coding is tougher to do, but it seems unfortunate that we are 
just coming out with systems with 2, 3, 4, ... processors and simultaneously 
coming out with software which isn't fully reentrant.  Fortunately, I don't 
think any of our competition have a fully reentrant implementation of X either,
so we're "safe", for now...

							Ralph

90.5Confused, I amMQOP12::P_BOURASSAPierre ...� Montr�alFri Feb 03 1989 12:4933
RE .2

�It sounds to me like you were talking more about Ada-style multi-threads; rather
�than multiple active AST levels.  In this case, I think the main problem you
�will find is that for now you can't call XTInitialize more than once per
�real process.  Thus if you have multiple threads within a single process which
�are creating separate display connections, etc, you will be in trouble, since
�presumably each tk application will call XtInitialize. 

This is exactly what I need: multiple display servers managed by the
same VMS process.  So I guess the answer to my original question is NO
since I can't call XtInitialize for each display server?  I need to use
it the same way ACMS will use DECforms; by calling the asynchronous
service which are reentrant.

� This should be fixed in VMS V5.2.

Does it means that the toolkit will be reentrant in VMS V5.2?

RE: .3

�The problems with Ada-style multithreading and AST-based multithreading are
�the same.  The stumbling block is that the toolkit isn't reentrant.  In an
�Ada tasking environment, everything works just fine if you do all toolkit
�calls from one task only.

I don't know if I understand this correctly.  To me, multi-threaded means
a single process dealing with many actions (usually many external devices
of the same type).  To do this, you usually need an AST like mechanism to
wake up the mainline that deals with a single thread at a time.  I don't 
know about ADA style multi-threading.  Sure the code must be reentrant
otherwise a thread will affect the next.

90.6Can do!TBD1::BURLEIGHHuman life begins at conceptionFri Feb 03 1989 14:4117
    You *can* control multiple displays from the same process using
    the current Xtoolkit:
    
    1) call XtToolkitInitialize() once;
    2) call XtCreateApplicationContext() once;
    3) call XtOpenDisplay(...) any number of times;
    4) call XtAppCreateShell(...) for each display;
    5) build widget hierarchy for each display;
    6) call XtRealizeWidget(...) for each display's top-level (shell)
       widget;
    7) call XtAppMainLoop() once;
    8) enjoy.
    
    For a simple example of this, see tbd1::decw$ll:chess.*,build_chess.com
    
    Dave

90.7LEOVAX::TREGGIARIFri Feb 03 1989 16:1110
> � This should be fixed in VMS V5.2.
>
> Does it means that the toolkit will be reentrant in VMS V5.2?

No.  It means you should be able to call XtInitialize more than once
in VMS V5.2.

Leo

90.8ClarificationDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Fri Feb 03 1989 16:1320
I think I confused things more than I helped.  Yes the toolkit is not reentrant.
Critical sections are not protected against ASTs.  If the threads requested in
.0 are switched by an AST, then it won't work even in 5.2.

However, starting in 5.2, you will be able to have multiple independent sections
of code each of which call XtInitialize and play along merrily as though there
is no other connection in that process.  The issue is synchronizing the threads.

Currently Xlib is usable at both USER and USER AST levels.  In that sense it is
reentrant.

The reason for this problem, of course, is that the tk intrinsics development
was done initially on Unix, where ASTs and the like are not a concern.  Jim
Gettys was kind enough to protect critical sections in Xlib with lock and unlock
macros which we filled in with OS-dependent stuff to prevent ASTs from happening
in these sections.  I don't know if such things exist in the toolkit or not.
If not, making them reentrant will be a lot harder.

Burns

90.9What are the plans for full reentrancy using CMA or ADA like threads?IO::MCCARTNEYJames T. McCartney III - DTN 381-2244 ZK02-2/N24Thu Mar 09 1989 11:116

When can we expect to see full rentrancy in the toolkit?

James