[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

2812.0. "XIO connection error, time bomb" by TALLIS::JBELL (Zeno was almost here) Thu May 24 1990 16:36

    I've got a program that does a series of XPutImage calls
    and tries to do them as fast as possible.  It runs fine for
    about 30 seconds and then fails with this error:



XIO:  unable to open connection humana::0
      after 27423744 requests (46848 known processed) with 2816 events remaining
.
%


    I'm running on a 8800 with Ultrix T4.0-1 (144) and displaying
    on a uVax II running vms 5.3.

    Any clues?

    -Jeff Bell
T.RTitleUserPersonal
Name
DateLines
2812.1DECWIN::FISHERPrune Juice: A Warrior's Drink!Thu May 24 1990 17:435
Are you reading events?  I'll bet that something you are doing is creating
events and you are ignoring them.  Plus that is a heck of a lot of requests.
Do you think that is right?

Burns
2812.2flow control?TALLIS::JBELLZeno was almost hereThu May 24 1990 18:4414
>Are you reading events?  I'll bet that something you are doing is creating
>events and you are ignoring them.  Plus that is a heck of a lot of requests.

    I'm trying to write a little animation program.  It does
    XPutImage as fast as it can.  I don't know if it will be
    client compute bound or server bound, but clearly something
    along the pipe will get saturated.

    I put a check in for stange events, and there were none.
    Maybe I don't have all events enabled  or some such ???

    Is there a mechanism for flow control?

    -Jeff Bell
2812.3Show us your code...SCAM::DIALFri May 25 1990 10:361
    Can you post the code, or a pointer to it?
2812.4here's the codeTALLIS::JBELLZeno was almost hereFri May 25 1990 11:13131
Below is the X related portion of the code.

I've taken out the graphics generation stuff.
(i.e. it won't compile)

code follows


#include "decw$include:Xlib.h"
#include "decw$include:Xutil.h"

Display *mydisplay;
Window mywindow;
GC mygc;
XImage * myimage;
Drawable mydrawable;

XEvent myevent;
KeySym mykey;

XSizeHints myhint;
int myscreen;
unsigned long myforeground, mybackground;
int i;
int done;
int sync_cnt;
char text[16];
char mybitmap[256][32];
int sky[256];

....
left out the graphics generation

....

/*************** window stuff starts here *************/
win_start(argc,argv)
     int argc;
     char **argv;
{
  mydisplay = XOpenDisplay("");
  myscreen = DefaultScreen(mydisplay);
  mybackground = WhitePixel(mydisplay, myscreen);
  myforeground = BlackPixel(mydisplay, myscreen);  
  myhint.x = 200;myhint.y = 50;
  myhint.width = 256; myhint.height = 256;
  myhint.flags = PPosition | PSize;  

  mywindow = XCreateSimpleWindow (mydisplay,DefaultRootWindow (mydisplay),
				  myhint.x,myhint.y,myhint.width,myhint.height,
				  5, myforeground, mybackground);
  XSetStandardProperties (mydisplay, mywindow, "fract", "fract",
			  None, argv, argc, &myhint);
  mygc = XCreateGC (mydisplay, mywindow, 0, 0);
  XSetBackground (mydisplay, mygc, mybackground);
  XSetForeground (mydisplay, mygc, myforeground);
  XSelectInput (mydisplay, mywindow,
		ButtonPressMask | KeyPressMask | ExposureMask);
  XMapRaised (mydisplay, mywindow);
  myimage = XCreateImage(mydisplay, DefaultVisual(mydisplay,myscreen),
			 1,XYBitmap,0,mybitmap,256,256,32,32);
}

win_stop() {
  XFreeGC (mydisplay, mygc);
  XDestroyWindow (mydisplay,mywindow);
  XCloseDisplay (mydisplay);
}

win_clear_image()
{
  char* data;
  int a;

  data = (char *) mybitmap;
  for (a=0;a<(256*32);a++)
    data[a]=0;
}

win_process_event(){
  XNextEvent(mydisplay, &myevent);
  switch (myevent.type) {
  case Expose:
    if (myevent.xexpose.count == 0) {
      XPutImage ( mydisplay, mywindow , mygc, myimage, 0,0, 0,0 ,256,256) ;
    }
    break;

  case MappingNotify:
    XRefreshKeyboardMapping (&myevent);
    break;
    
  case KeyPress:
    i = XLookupString (&myevent, text, 10, &mykey, 0);
    if (i== 1 && text[0] == 'q') done=1;
    break;

  default:
    /*    printf("got an enexpected event\n"); */
    break;

  }
}

/********** end of xwindow stuff ***********/

/********** main starts here ****************/
main (argc,argv)
     int argc;
     char **argv;
{
  setup_world();

  win_start(argc,argv);  
  XNextEvent (mydisplay, &myevent);

  done = 0;
  while(done == 0) {

    win_clear_image();

    draw_view();     <----  This does XPutPixel calls.

    XPutImage ( mydisplay, mywindow , mygc, myimage, 0,0, 0,0 ,256,256);

    while(XEventsQueued(mydisplay,QueuedAfterReading))
      win_process_event();
  }
  win_stop();
  exit(0);
}
2812.5just too much?TOOLEY::B_WACKERFri May 25 1990 11:185
You might try slowing it down with a lib$wait and see if you aren't 
just overpowering the server and overflowing its queue.  An 8800 
against a uvII is pretty uneven.

Bruce
2812.6The speed of the application shouldn't matterSTAR::VATNEPeter Vatne, VMS DevelopmentFri May 25 1990 12:5419
>You might try slowing it down with a lib$wait and see if you aren't 
>just overpowering the server and overflowing its queue.  An 8800 
>against a uvII is pretty uneven.

It is not possible for an 8800 or even a 9000 to "overpower" a server.
The server will take requests from the connection as fast as it can.
If it can't keep up, the buffers will fill up, and the application
will block.  The problem usually comes when the server sends back
events, and the application doesn't keep up with reading them.  If
the buffers from the server to the client fill up, then the server
aborts the connection, and the application dies.

If the application attempts to read events after each XPutImage call,
then then the server's event buffers should never overflow.

What Burns was suspicious about was that Xlib reported that 27423744
requests had been processed.  It seems highly unlikely that one program
can generate that many requests in 30 seconds, especially if they are
"heavy" requests like XPutImage!
2812.7synch didn't helpTALLIS::JBELLZeno was almost hereFri May 25 1990 13:059
> You might try slowing it down with a lib$wait and see if you aren't 
> just overpowering the server and overflowing its queue.  An 8800 
> against a uvII is pretty uneven.

    I tried doing a X$Synchronize every 30 cycles.
    It blew up at about the same place.

-Jeff

2812.8never mind.....TALLIS::JBELLZeno was almost hereWed May 30 1990 16:1010
    I found it.... I was sending some out of range values to XPutPixel.
    It just hppened to take a while unitl it hammered my display data.

    OOOOPS


    -Jeff Bell