home *** CD-ROM | disk | FTP | other *** search
- From: lang@hpfcso.FC.HP.COM (John J. Lang)
- Date: Mon, 4 Jan 1993 17:30:12 GMT
- Subject: Re: Using starbase in X
- Message-ID: <7371511@hpfcso.FC.HP.COM>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Path: sparky!uunet!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!lang
- Newsgroups: comp.sys.hp
- References: <1993Jan3.225641.22767@news.media.mit.edu>
- Lines: 38
-
- In comp.sys.hp, floyd@media.mit.edu (Bob Sabiston) writes:
- > Does anyone know if the R_LOCK_DEVICE gescape can be used in programs
- > that run in Xwindows? If so, anybody have any idea what could cause the
- > program to hang my machine?
-
- It is possible to use R_LOCK_DEVICE in an X window, but not easy. What
- is probably happening is that a Starbase call sent a request to the
- X server. If the device is locked, the X server cannot continue, and a
- deadlock happens (ie. Starbase is waiting on the X server, the X server
- is waiting for the device lock, which Starbase has). This could also
- happen if you program is making Xlib calls
-
- If you have to use R_LOCK_DEVICE, make sure you unlock the device before
- you make any Starbase calls. For example, your code should be organized
- like this:
-
- starbase_call()
- starbase_call()
- gescape(R_LOCK_DEVICE)
- for each pixel {
- access frame buffer
- }
- gescape(R_UNLOCK_DEVICE)
- starbase_call()
-
- Another problem with accessing the frame buffer directly, is that you
- must know the location of the window you are accessing. There is no
- protection to keep you from drawing outside the window. There is also
- no way to find out what parts of your window are obscured by other
- windows. This means you program must always keep it's window as the
- topmost, and you must inquire the location and size of your window.
- This is of course easier if you are just doing something for your
- personal use (since you can control the environment) rather than a
- general utility or application. In any case, the above should indicate
- how to get around the hang.
-
- John Lang
- lang@fc.hp.com
-