|
From: Bart V. <bar...@zo...> - 2006-05-11 10:13:18
|
Prometheus Prometheus wrote: > hiho@ll <mailto:hiho@ll> > =20 > i'm just working on a patch, which i would need for caching CLI scripts= > on linux (so i use shmget,...) > the problem is that under CLI nothing get's cached > for apache it seems to work > =20 > what i did: > i changed the shared memory to NOT remove it after exit from CLI (seems= > to work) > and removed the memset(); which set's the shared memory to 0 (i moved > this to mm.c to initialize it if the shared mem is created first time) > =20 > any suggestion would be greate, for help with this > =20 > what i know is that the shared memory is working (it doesn't get remove= d > and i have no segmentation fault if only used in cli) > i get a segfault (don't really know why cause it's a bit hard to debug,= > cause of my developing environment (no gdb,...)) if e.g. execute a cli > script, and then run a apache script (apache gets segfault) OR if i > execute a apache script and then run a cli script (CLI creates segfault= ) > only running CLI scripts i get NO segfault BUT nothing gets cached > =20 > for my productive environment i don't need to mix apache and CLI, so i'= m > not sure if i should be interested in the segfault (if i had, i could > create 2 different shared memories depending on environment, but for no= w > i need to get it work and this segfault is a "special" case) > =20 > so my question: > cause i'm not the best php extension hacker, WHAT makes my "patch" NOT > working? > another question would be: > which code, creates a cache entry? and why there is no script cached in= CLI? > i mean, if i change the shared memory so it doesn't get deleted, and > start a test script, NO script is cached > why? > i know that you (eac developers) would need much more info on this (but= > i think i don't have) > so i don't want a solution from you > what i would need is a hint and maybe a little description, what's the > problem (what the problem could be) with CLI, cause i'm sure you > agonized much more on this topic > =20 > any hint would be great!! > thx!!! There are a few problems with this aproach: 1) You don't have a way to cleanup the memory 2) When do first initialise the memory? When do you do memset? 3) You don't know where that segment gets attached. The restore code for memory doesn't fixup pointers! The best way to implement such a feature would be 'disabling' shared memory and only using file cache. This would give you a bit of overhead but not much because you will have to do the 'fixup' always when loading files cross-process. gr, Bart --=20 Bart Vanbrabant <bar...@zo...> PGP fingerprint: 093C BB84 17F6 3AA6 6D5E FC4F 84E1 FED1 E426 64D1 |