[Tutor] Shared FIFO?

Alan Gauld alan.gauld at btinternet.com
Mon May 18 09:19:21 CEST 2009


"Allen Fowler" <allen.fowler at yahoo.com> wrote 

> I have several CGI scripts that I would like coordinate via a 
> "First In / First Out" style buffer.    That is, some processes 
> are adding work units, and some take the oldest and 
> start work on them.
> 
> What is the right way to do this?    
> I suppose I could use an SQL server or SQlite , 
> but that seems very complex for just a FIFO.

Given how easy it is to use something like SqlLite from 
Python I don't think its an unreasonable approach and 
it avoids or eases some of the hidden complexities 
around using simple files (such as locking issues).

But a lot will depend on transaction volumes etc. If 
you never, or rarely, have concurrent accesses then using 
a text file might work. Or you could do it all in memory 
via a long running process and a queue. But if volumes 
are (or could become) high or bursty I'd go for the SQL route.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list