Re: Locking threads



I'm developing a CMS and I'd like to be able cache the site "tree" in
a multi-dimensional array in shared memory (far too many sql calls
otherwise). When someone adds an item in the tree I need to be able to
read in the array from shared memory, add the new item, then write it
back to shared memory.....all in one atomic action.

I've done plenty of research and short of using something like
eaccelerator or mmcache I'm stuck with PHP semaphores which even then
don't appear to be thread safe, only process safe (correct me if I'm
wrong) - and then I'm restricted to *nix systems.

Is there any way to create a method of doing the above which will work
on *nix and Windows, whether it's multi-threaded or single-threaded?

Jim,

Use a database. There are dozens around which use databases; if
implemented properly they can be quite efficient.

Hi Jerry,

If I could think of a way of doing it efficiently then I'd stick with
db only, but I can't see how. For example, I have a table which
represents the structure of the site, so to put it simply each record
has an id and a parent id. To build say a left hand nav I may need to
call 3 or 4 sql statements to get all the data I need which I'd like
to avoid doing if possible.

Thanks,

Jim.

.



Relevant Pages

  • Re: Locking threads
    ... a multi-dimensional array in shared memory (far too many sql calls ... All of these can easily take more time than a simple database access. ...
    (comp.lang.php)
  • Re: Local named pipes better than TCP/IP?
    ... By default the driver will automatically ... shared memory and if the driver connects to remote SQL it will use TCP-IP. ... > It's about what I shall recommend all our customers. ...
    (microsoft.public.sqlserver.connect)
  • Re: SQL Server 2005 and security patch issues?
    ... connection, and it worked fine, and I hadn't changed anything. ... it's a bit spooky with shared memory stopping to work. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Links for SQL Server Books Online: ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Server 2005 Express: RAM voll?
    ... ob die Protokolle für die Clients aktiviert sind (Shared Memory, ... Also in der SQL Native Client Configuration, ... TCP/IP - Disabled ... Named Pipes - Disabled ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: Locking threads
    ... I'm developing a CMS and I'd like to be able cache the site "tree" in ... a multi-dimensional array in shared memory (far too many sql calls ... When someone adds an item in the tree I need to be able to ... read in the array from shared memory, add the new item, then write it ...
    (comp.lang.php)