how ngx.shared.DICT could be locked

Vladimir Shebordaev vshebordaev at
Tue Jan 8 10:01:25 UTC 2013


On 08.01.2013 13:09, Anatoli Marinov wrote:
> Hello Colleagues,
> I am wondering is there a method for shared dictionary locking.
> In my script I have to flush all records from the dictionary and
> after that the script will put new records. In this time I do not
> want other workers to read the partially loaded dictionary.
> So is it possible to lock it for a very small period of time?

This heavily depends on how your dictionary is accessed from 
within nginx. If once the dictionary resides in shared memory 
region, you could also use standard system wide IPC primitive 
like a semaphore to lock it from your load script.

> Thanks in advance
> Anatoli Marinov


More information about the nginx-devel mailing list