[MTOS-dev] Background Task Change

Reed A. Cartwright reed at scit.us
Fri Feb 8 12:02:15 PST 2008


With the discussion on pronet about background tasks I have a proposal 
to make to change the background task system.

Instead of forking to do background tasks, MT should process them after 
the page is finished being served.  This is the technique that I use in 
MT-Dispatch to run the the Schwartz (publishing queue) in the worker 
threads.

The basic pseudo code is as follows:

1. open connection
2. run app, queuing any bg tasks
3. send page to user
4. close connection (streams)
5. go through bg queues
6. terminate if cgi; server next request if fcgi

I think this would improve task processing and even become more portable 
since MTOS wouldn't need to use fork.

-- 
*********************************************************
Reed A. Cartwright, PhD     http://scit.us/
Postdoctoral Researcher     http://www.dererumnatura.us/
Department of Genetics      http://www.pandasthumb.org/

Bioinformatics Research Center
North Carolina State University
Campus Box 7566
Raleigh, NC 27695-7566

Cuiusvis hominis est errare, nullius nisi
insipientis in errore perserverare. --Cicero


More information about the MTOS-dev mailing list