[tpm] fork and blessed hash references

Stuart Watt stuart at morungos.com
Thu Jan 14 08:25:30 PST 2010


Madison Kelly wrote:
> However, that led us to 'alarm', which might just be the ticket.
>
>   The idea is; Setup a SIGALARM handler that shuts down the daemon, 
> then on setup set an alarm for X time in the future. After that, each 
> method call can call 'alarm' for Y time in the future, hopefully 
> clearing the current pending alarm(s) and pushing the back into the 
> future. Once there is enough time with no activity, the SIGALARM will 
> call the handler and will shut down the daemon. 
alarm works very well for timeouts - we even use it on Windows, which 
breaks fork() even more. If notification is all you need, not data 
sharing, its all fairly straightforward.

For data sharing, it sounds slightly crazy, but the simplest solution 
for us was to use DBI and SQLite, with its exclusive transactions. These 
allows us to coordinate safe data access between processes, and it works 
on all platforms safely.

All the best
Stuart



More information about the toronto-pm mailing list