[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

1107.0. "2 Processes & X$SYNC, Ensuring I/O to one window" by WR2FOR::LAMB_PE (Peter Lamb - FSG Santa Clara) Fri Jul 14 1989 13:42

Hi,

    I have a customer that is doing a great deal of DECwindows programming
    and as their on site software specialist they have asked me to research
    the following questions (unfortunatly I realize I still have a lot
    to learn about DECwindows).   If anyone can help it would be
    greatly appreciated.  Note I read the discussion in 852 regarding
    X$SYNC but it didn't seem to really be related...
    
The customer has two different questions regarding DECwindows...

    1) They have been having dificulties syncronizing two seperate
    processes that need to put up windows in sync.  Basically they have one
    process that needs to put up a background window this process askes
    DECwindows to put up the first window and calls the sync routine (they
    didn't give me the name of the call but its part of the X or decwindows
    toolkit X$SYNC??). They then send a message to the other process and
    tell it that it is ok to put up the other (foreground) window.  For
    some reason the foreground window typically ends up displaying first.
    If they add a wait inside the program of the first process between the
    time it puts up its window and tells the second program to put up the
    foreground window everything works.  However, they don't feel
    comfortable with having to have a wait x parameter in their program and
    would like to know why the xwindow sync routine is not working. 

    Note:  They suspect that perhaps the problem is that the sync call only
    works when all the windows are displayed from the same process.  Is
    there anyway to ensure syncronization when windows are being displayed
    from more than one process? 

    2) They would also like to know if there is any way to ensure that a
    certain window will always get priority.  For example if one window
    needs to update once a second (a bunch of numbers for example) and
    someone brings up a large map in another screen, they need some way to
    ensure that the other more important screen will continue to be
    updated.  I spoke to someone about this and they indicated that normal
    VMS priorities should take care of this but I'm not sure that I believe
    it - wouldn't the X window I/O queuing get in the way?  If it would how
    can they tell it which one to do first? 

Thanks and regards,

Peter Lamb
    
                                           

T.RTitleUserPersonal
Name
DateLines
1107.1Use XGetImage but only if you have to it's slowSTAR::BMATTHEWSFri Jul 14 1989 13:598
The only way to ensure that the draw has actually reached the frame buffer
is to do an XGetImage call for say one pixel in the window.

To sync the two windows you need to communicate between the 2 apps. What has
already been queued to the window system will still be processed however.

					Bill

1107.2Wait for exposeGVRIEL::SCHOELLERWho's on first?Fri Jul 14 1989 14:2715
Q1
Mapping the window and synching does not guarantee that the operation will be
done in time for some other operation.  Instead, they should map, WAIT FOR
THE EXPOSE EVENT and then notify the other process.  That way the other process
will not even be notified until after the window is visible.

Q2
I am not sure but I think that you are right.  Once the commands are sent
to the server, it has no way to know about the priorities of the client
programs.  In theory, situations in which two clients have similar rates of
interaction with the server AND ARE RUNNING ON THE SAME HOST will allow priority
to have the effect you desire.  Otherwise, I suspect that you are SOL.

Dick

1107.3SDSVAX::SWEENEYHoney, I iconified the kidsFri Jul 14 1989 18:2718
    re: .0
    
    More basic issues: the "synchronization" in the X Window System is with
    respect to a clients connection to the server.  Synchronization with
    the server means that the server will send all the "server side" data
    to the client before processing the next client message.  The "server
    side" data is typically errors and input for that client.
    
    The is no way to impose synchronization on all the other clients of the
    server.  Philosophically, it seems unfair to me for one client to impose
    it on another without agreement.
    
    Stacking order (which window is on top of another) doesn't need to
    depend on creation order: the first window can always XRaiseWindow
    itself to assert that it is on top of the stacking order whenever it
    needs to.
                                                       

1107.4Use MapNotify events for problem #1DECWIN::KLEINMon Jul 17 1989 12:4132
>>    1) They have been having dificulties syncronizing two seperate
>>    processes that need to put up windows in sync.  Basically they have one
>>    process that needs to put up a background window this process askes
>>    DECwindows to put up the first window and calls the sync routine (they
>>    didn't give me the name of the call but its part of the X or decwindows
>>    toolkit X$SYNC??). They then send a message to the other process and
>>    tell it that it is ok to put up the other (foreground) window.  For
>>    some reason the foreground window typically ends up displaying first.
>>    If they add a wait inside the program of the first process between the
>>    time it puts up its window and tells the second program to put up the
>>    foreground window everything works.  However, they don't feel
>>    comfortable with having to have a wait x parameter in their program and
>>    would like to know why the xwindow sync routine is not working. 

The problem here is that the window manager is causing the window map
request to be redirected.  The solution is to solicit and wait for a
MapNotify event associated with the first (background) window before sending
the "ok" message to the foreground process.

The redirection of the MapWindow request essentially forks a thread from
the requesting process into the window manager.  The X$SYNC request
only waits for the MapWindow request to have been received by the server
and forwarded to the window manager.  It does not wait for the window
manager to reissue the request.  In fact, it can take quite a while
for the window manager to get around to it.

Only when the "background" process receives the MapNotify event for the
background window can it know for sure that the window is mapped and
only then can the "foreground" process be started.

-steve-