🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #7036

Re: Setting priority for 2 interacting programs

#7036
From: BAXTER_A
Date: Mon, 26 Nov 1990 18:57
36 lines
1767 bytes
In article <16666@wehi.dn.mu.oz>, BAXTER_A@wehi.dn.mu.oz writes:
> PROBLEM:
> 
> Program A spools a file to disk and execute()s a command to type
> the file to a device which prints it after some processing.
> 
> Program A runs at priority 0, device runs at priority 5.
> 
> Device hoggs processor, and Program A does bugger all, making the
> spool fairly useless.
> 
> Thus Program A at priority 0, device at priority 0.
> 
> Works fine, except now, if Program A tries to write direct to device
> with fprintf() calls, the system hangs (or seems to, I got bored).
> 
> This does _not_ happen if device priority is set to 5.
> 
> Note, I do not check the return code from fprintf(). Should I? What's
> wrong with this? How do I get the two programs to talk to each other
> politely without stepping on each others toes?
> 

Further to this, the actual command that hangs is:                                                                
                                                                                    
   if (!(fp = fopen(plotname,"w") )) { Message("ERROR: Can't write to
file:",plotname); return(FALSE);}

Where plotname is a string which contains the name of the device.

It appears that fopen() has trouble opening a device with a low priority
but does not actually fail.

Any ideas?

Regards Alan
Technical Details
Message-ID: <16667@wehi.dn.mu.oz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!wehi!baxter_a
References: <16666@wehi.dn.mu.oz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!ariel!ucsvc.ucs.unimelb.edu.au!wehi!baxter_a
From: BAXTER_A@wehi.dn.mu.oz
Newsgroups: comp.sys.amiga.tech
Subject: Re: Setting priority for 2 interacting programs
Message-ID: <16667@wehi.dn.mu.oz>
Date: 26 Nov 90 18:57:40 GMT
References: <16666@wehi.dn.mu.oz>
Organization: Walter & Eliza Hall Institute
Lines: 36