🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.oberon
Article #1267

Oberon/F multi-tasking alte

#1267
From: Marc Martin
Date: Wed, 03 Apr 1996 19:00
45 lines
2775 bytes
 Subject: Oberon/F multi-tasking alternatives?

This is a question regarding the Oberon/F framework -- thanks in advance for
any replies!

I recently ported over a CPU-intensive program from the Macintosh API to the
Oberon/F framework.  Since this program can take several minutes to complete
a single task, I'd like to make it run in the background so that I can do
other things while it is executing.

When this program was implemented using the Macintosh API, I implemented
cooperative multitasking by merely inserting calls to a procedure which would
check and clear the event queue.  This method seemed fairly straightforward,
did not force me to restructure my code, and allowed me to easily experiment
with how many calls I needed to make the system responsive.

Now I'm looking at what the Oberon/F framework has to offer in this area. 
The "Action" object in "Controllers" ("Services" in v1.2) seems to be the
only support for cooperative multitasking.  However, unlike my Macintosh API
solution, this feature wants me to rewrite all of my loops into recursive
procedure calls.  The system then does other processing in between these
calls.  

While the Oberon/F solution is probably not so bad for simple loops, my
program is not so simple.  It uses a black-box Fortran DLL which calls my
Oberon/F procedures as it pleases, and these procedures have loops within
loops within loops.  I'm sure there is probably some way to rewrite all of
this to work using Oberon/F actions, but I don't think it would bear much
resemblance to the original code, it certainly wouldn't be easy to read, and
it certainly wouldn't be easy to adjust system responsiveness.

I'm wondering -- is there another way to implement background tasks within
Oberon/F?  Something similar to the way I did it on the Macintosh API would
be ideal...just a single procedure to allow other processing and then let my
program continue.    Perhaps Oberon Microsystems would even consider adding
such a feature to Actions in the future.  
I'd envision something like the below (with a much shorter procedure name!):

  PROCEDURE (a: Action)
AllowOtherProcessingForTheMomentThenContinueThisAction



Marc Martin
Marc.Martin@msd.ds.boeing.com 
Technical Details
Message-ID: <n1383593554.58113@msd.ds.boeing.com>
Path: arc1-ca.pugleaf.net!inf.ethz.ch!oberon-news@inf.ethz.ch

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!inf.ethz.ch!oberon-news@inf.ethz.ch
From: "Marc Martin" <marc.martin@msd.ds.boeing.com>
Newsgroups: comp.lang.oberon
Subject: Oberon/F multi-tasking alte
Date: 3 Apr 1996 21:00:37 +0200
Organization: Dept. Informatik, Swiss Federal Institute of Technology
Sender: server@inf.ethz.ch
Distribution: world
Message-ID: <n1383593554.58113@msd.ds.boeing.com>
Reply-To: oberon-news@inf.ethz.ch
NNTP-Posting-Host: neptune.inf.ethz.ch
Originator: oberon-news@inf.ethz.ch
X-Mailer: Mail*Link SMTP-QM 3.0.1