WALL-E / Practice

练习手册
0 stars 0 forks source link

ngx lock_file指令 #12

Open WALL-E opened 7 years ago

WALL-E commented 7 years ago
Syntax: lock_file file;
Default: lock_file logs/nginx.lock;
Context: main

nginx uses the locking mechanism to implement accept_mutex and serialize access to shared memory. On most systems the locks are implemented using atomic operations, and this directive is ignored. On other systems the “lock file” mechanism is used. This directive specifies a prefix for the names of lock files.

WALL-E commented 7 years ago

nginx uses accept mutex to serialize accept() syscalls. If nginx is built by gcc, Intel C++, or SunPro C++ compilers on i386, amd64, sparc64, and ppc64, then nginx uses the atomic instructions to implement the mutex. In other cases the lock file would be used.