1

I am using Apache/2.4.41 (Ubuntu), with mod_perl. Apache uses multiple threads, and I want to share read/WRITE data between threads. In "Practical mod_perl" Stas Bekman describes how to share read-only data between threads, but says nothing about how to share WRITABLE data between threads, so that one thread can modify data that all threads see.

How can this be done, and what mechanisms are available -- such as locks or semaphores -- to coordinate shared data access between threads?

DavidBooth
  • 101
  • 1
  • 9

1 Answers1

1

Suggestions received via the modperl mailing list:

  1. Use the IPC::Sharable module to access memory that can be shared by multiple processes (and threads). (Credit: Jacques Deguest)

  2. Use a cache server (Redis/Varnish/Elasticache/etc. (Credit: Brad Van Sickle)

  3. Reconsider my approach, because mod_perl's copy-on-write architecture is a bad fit for this. (Credit: Brad Van Sickle)

DavidBooth
  • 101
  • 1
  • 9