🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Tasking

#2983
From: Henry J. Cobb
Date: Sun, 18 Mar 1990 16:49
38 lines
2017 bytes
	How I handle subtasks:

	My subtask starts out waiting at a port.  When I have somthing for it 
to do I hand it a message at that port, it goes and does its thing, replys the
message and then waits at that port.

	Any time my main program is holding the message it may safely kill the
subtask, modulo resources.

	Example: task to manage a window:

A:	The main program at some time tells the waiting task to open a window.
	(The message to the task includes some parameters for that window).  
	The task calls openwindow and replies with the result, and goes back 
	to waiting.

B:	The program decides that it wants some input, so sends the task a 
	request for input.  The task turns on the menu bar and waits for
	messages from either the IDCMP or task-control ports.

C:	If the task gets an input from the IDCMP it turns off the menu bar
	and notes the input in the task control message which it now replies
	to and waits on the ports. 

D:	Finally the program tells the task to close its window and clean up.
	With the reply in hand in now kills the task.

	Note that the main program does nothing but manage tasks.  It is almost
always free to respond instantly to new inputs, and the outstanding requests
to its subtasks tells it what it must do to shut down:

while(some_request_outstanding)
	wait(on_all_outstanding_tasks)
	for each_responding_task	
		killtask(responding_task)
	Henry J. Cobb	hcobb@ccwf.cc.utexas.edu
	"I was not here; I did not say this."
Technical Details
Message-ID: <26351@ut-emx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!hcobb
References: <22138@watdragon.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ut-emx!hcobb
From: hcobb@walt.cc.utexas.edu (Henry J. Cobb)
Newsgroups: comp.sys.amiga.tech
Subject: Tasking
Keywords: Lattice, CreateTask
Message-ID: <26351@ut-emx.UUCP>
Date: 18 Mar 90 16:49:52 GMT
References: <22138@watdragon.waterloo.edu>
Sender: news@ut-emx.UUCP
Reply-To: hcobb@walt.cc.utexas.edu (Henry J. Cobb)
Organization: The University of Texas at Austin
Lines: 38
In-reply-to: sjorr@rose.waterloo.edu (Stephen Orr)