[comp.sys.sgi] sproc

messerli@biophys.zir.ethz.ch (Marius Messerli) (08/13/90)

I tried to creat multiple processes with sproc(2). These processes
should write into the same window to split the work to different 
cpu's. The job sharing works if I do something else (no gl operations) 
but fails to do anything upon gl-calls. 

sproc(entry, inh, arg);
with inh is set to PR_SALL

Thanks very much for any help!
Marius.

markv@gauss.Princeton.EDU (Mark VandeWettering) (08/13/90)

In article <4687@biophys.zir.ethz.ch> messerli@biophys.zir.ethz.ch (Marius Messerli) writes:

>I tried to creat multiple processes with sproc(2). These processes
>should write into the same window to split the work to different 
>cpu's. The job sharing works if I do something else (no gl operations) 
>but fails to do anything upon gl-calls. 

You may not do this in SGI IRIX v3.2 or before, but I believe that restriction
is about to be lifted in version 3.3.  

Mark

messerli@biophys.zir.ethz.ch (Marius Messerli) (03/13/91)

I'm trying to get a piece of code using sproc(2) together with winopen().
The program consists of a process handler with no connection to the 
graphics master, a graphical user_interface and the application suroutines 
that have their own windows. 

I have two main problems:

    - As soon as a share group process opens a connection to the graphics 
      master (does winopen call) it cannot change the global variables 
      "backward" so that the process handler gets them.
      To give the user_interface the possibility to tell the 
      process handler what to I use a pipe (although globals would be 
      more appropriate).

    - Although having set the PR_SALL flag in all sporc calls the individual 
      application subroutines (each having its own window) do have their 
      own copy of the data!

It seems that after a winopen call the share group process makes its own 
copy of the data space ? Is that so ?

Thank you for any explanations and hints.

=========================================
Marius Messerli
Institute for Cell Biology
ETH-Zuerich
messerli@zellbio.ethz.ch
========================================

bron@bronze.wpd.sgi.com (Bron Campbell Nelson) (03/14/91)

In article <7858@biophys.zir.ethz.ch>, messerli@biophys.zir.ethz.ch (Marius Messerli) writes:
> 
> I'm trying to get a piece of code using sproc(2) together with winopen().
> The program consists of a process handler with no connection to the 
> graphics master, a graphical user_interface and the application suroutines 
> that have their own windows. 
> 
> I have two main problems:
> 
>     - As soon as a share group process opens a connection to the graphics 
>       master (does winopen call) it cannot change the global variables 
>       "backward" so that the process handler gets them.
>       To give the user_interface the possibility to tell the 
>       process handler what to I use a pipe (although globals would be 
>       more appropriate).
> 
>     - Although having set the PR_SALL flag in all sporc calls the individual 
>       application subroutines (each having its own window) do have their 
>       own copy of the data!
> 
> It seems that after a winopen call the share group process makes its own 
> copy of the data space ? Is that so ?
> 

One possible thing to try is to call "foreground" before the first winopen.
When winopen is called, the default behaviour for the graphics library
is to "fork" the process and run the child.  If you are using sproc, you
don't want this behaviour (i.e. the forked child gets a copy of the data
and is no longer part of the process share group).  Calling foreground
will suppress the fork.

I don't know if this will cure all your ills, but it is worth investigating.

--
Bron Campbell Nelson
bron@sgi.com  or possibly  ..!ames!sgi!bron
These statements are my own, not those of Silicon Graphics.

micah@flobb4.csd.sgi.com (Micah Altman) (03/14/91)

In <7858@biophys.zir.ethz.ch> messerli@biophys.zir.ethz.ch (Marius Messerli) writes:


>I'm trying to get a piece of code using sproc(2) together with winopen().
>The program consists of a process handler with no connection to the 
>graphics master, a graphical user_interface and the application suroutines 
>that have their own windows. 

>I have two main problems:

>    - As soon as a share group process opens a connection to the graphics 
>      master (does winopen call) it cannot change the global variables 
>      "backward" so that the process handler gets them.
>      To give the user_interface the possibility to tell the 
>      process handler what to I use a pipe (although globals would be 
>      more appropriate).

Best guest: The first winopen() actually creates a separate process when called,
	and kills the original process . This can confuse some
	multiprocessing window handling, signal handling,etc.
 Do the winopen() first, before creating any child processes
using sproc(), this should keep things from getting confused. Or use
the foreground() call before doing your first  winopen().

>    - Although having set the PR_SALL flag in all sporc calls the individual 
>      application subroutines (each having its own window) do have their 
>      own copy of the data!

Even using PR_SALL, subroutines will have individual copies of their
own _local_ data ( data declared within the scope of the subroutine ),
global data ( COMMON's in Fortran ) are shared between all threads.

Hope this helps.
--
	"Entia non sunt multiplicanda sine necessitate." - William of Ockham
	Micah Altman, "Computational Juggler"	   	   micah@csd.sgi.com
	Phone (415) 335-1866				   FAX (415) 965-2309
	Disclaimer: 	Everything in this document is a lie.	

raible@nas.nasa.gov (Eric Raible) (06/20/91)

So does anyone have a method for passing multiple args using sproc(2), or
an sproc-like function?

What I *don't* need is suggestions to use a structure - for this
application that is indeed possible, but adds grief.

Please respond by email, I'll summarize if appropriate.

Thanks - Eric Raible (raible@nas.nasa.gov)