Is there a magic linux command that can pop and push lines from a text file (queue) in a multiprocess safe manner?
I can do the work creating the semaphores if I need to but I'm looking to make my PHP site add costly operations into a basic text file that then will be popped off and run by another process. It doesn't need to scale to enormous sizes. Is there a command such as 'cat_safe_queue >> queue.txt' and then another 'pop_safe_queue queue.txt' that will just take care of all of the locking for me? My site can have perhaps 100-200 costly operations occurring at one time where for now I would like to run only one at a time. The amount of time spent dealing in any inefficiencies with this approach would be inconsequential. This would just be magic and would be very elegant.
Posted May 31, 2011, 11:10 PM UTC
07