I've a program which needs to render several hundred thousand
polygons. I first store the information in a PEXStructure and
then issure PEXExecuteStructure. Building the structure takes
less than a second, but rendering can take up to a minute and
during this time the X-server is completely locked-up.
(We're running SUN SunOS Release 5.4 on a Sparc-10 with PEX 5.1.)
Question: is it possible to interrupt the Renderer?
I assume the answere is no, because the X-server does not
respond until rendering is done. Does anyone have a good
idea how to get around this problem?
Thanks for any advice!
-- Greg Kohring
------------------------------------------------------------------------------
G.A. Kohring | fax : [49]-[2461]-612430
Forschungszentrum Juelich GmbH | phone : [49]-[2461]-616761
D-52425 Juelich, Germany | e-mail: g.ko...@kfa-juelich.de
------------------------------------------------------------------------------
Not during the processing of a single request.
Some implementations of X/PEX servers can process
PEX and X requests at the same time to get around the problem
you describe. They do this by occasionally checking the
X request queue during a long rendering operation and
temporarily suspending PEX rendering while processing
X requests for other clients.
This can sometimes let other clients operate
while processing a lengthy PEX request.
Some other implementations run PEX in another process, which lets
the X server keep running. Of course, there are quite a few
timing and synchronization issues.
The advent of threaded X servers will improve the situation
in a more unified manner.
> I assume the answere is no, because the X-server does not
> respond until rendering is done. Does anyone have a good
> idea how to get around this problem?
Instead of using a single atomic request to draw the
entire structure, try drawing it in pieces.
Suppose you have 1000 elements and decide to render 100 at a time.
RenderElements(struct,1,100)
RenderElements(struct,101,200)
RenderElements(struct,201,300)
....
RenderElements(struct,901,1000)
Depending on the dispatching policy of the X server (I
forget the rules there), you may need an XSync between
each call.
Anyway, this should give the server at least a chance
to process requests for other clients while drawing
your picture.
Hope this helps.