location = /shared {
content_by_lua_block {
local dict=ngx.shared.dog;
local n1=ngx.now()
for i=1,100000 do
dict:add("hello",1)
dict:get("hello")
end_
local n2=ngx.now()
ngx.say("n1 : "..tostring(n1).." n2:"..tostring(n2))
}
}
上面这个location,当请求在循环体中访问 共享内存时,worker进程是否有可能会切换执行其它的请求?还是当前请求一直占用着worker进程?