in reply to Concurrent access to temporary and persistant storage

Personally I would use threads for this, but if that is a problem, then you might take a look at the forks module.

It is an emulation of threads and includes an emulation of the threads::shared functionality using sockets.

I've no idea if this would play well with the forking you already have, but if not, you might be able to steal the sockets implementation it uses to allow processes to share hashes and arrays. Most of the relevant code is in forks::shared module I think.

I thought it was worth a mention anyway.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


  • Comment on Re: Concurrent access to temporary and persistant storage

Replies are listed 'Best First'.
Re: Re: Concurrent access to temporary and persistant storage
by Anonymous Monk on Jun 03, 2003 at 22:31 UTC
    forks is not portable.

      Of that I am not sure, but I'll take your word for it.

      However, the socket code that underlies the mechanism that allows two or more forked processes to appear to share common hashes and arrays almost certainly is portable to any platform that supports sockets. If the OP has to come up with his own IPC mechanism to allowed multiple processes to share one or more hashes, the code in forks::shared would be a good place to buy wood, rather than having to grow a tree from seed.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller