run Rev app on two networked computers?

Richard Gaskin ambassador at fourthworld.com
Tue Jul 6 23:48:01 EDT 2004


Andre Garzia wrote:

> Solution #1) use files as semaphore to tag the locked status of the 
> stack, keep sure that stack in memory equals stack in the filesys. PROS: 
> your app is self contained. CONS: don't know, didn't think of any...

I've used that approach both locally and with CGI's, and for small 
traffic loads it seems to work okay.

I found it useful to put a time stamp in the semaphore file to monitor 
for timeouts.

I also added a loop at the beginning of my CGI script which polls the 
file on quarter-second intervals to see if it's been deleted.  That way 
a second instance can be held off from processing for a brief period and 
still complete the transaction when the first instance is done.

But this is only a good idea with CGIs where you expect minimal traffic. 
  I've only used it on a system with fewer than two dozen users running 
a custom client across five different time zones; the potential for 
conflict was low.

In a potentially high-volume venue, such as processing a form from a 
public web page, remember that each time the CGI is called it makes a 
separate instance (unless you're calling it with Apple events on a Mac 
server; the serves I use run FreeBSD), so it multiple concurrent posts 
can eat up resources quickly.

For high-volume traffic, a system with record-locking built-in (such as 
MySQL) is arguably a better way to go.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________
  Rev tools and more:  http://www.fourthworld.com/rev


More information about the use-livecode mailing list