<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/core/ngx_thread_pool.c, branch release-1.28.3</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>Use NULL instead of 0 for null pointer constant.</title>
<updated>2025-12-23T18:40:33+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2025-05-21T21:30:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=a39be5d9d296b72091f3181eea58303ac8d0828f'/>
<id>a39be5d9d296b72091f3181eea58303ac8d0828f</id>
<content type='text'>
There were a few random places where 0 was being used as a null pointer
constant.

We have a NULL macro for this very purpose, use it.

There is also some interest in actually deprecating the use of 0 as a
null pointer constant in C.

This was found with -Wzero-as-null-pointer-constant which was enabled
for C in GCC 15 (not enabled with Wall or Wextra... yet).

Link: &lt;https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were a few random places where 0 was being used as a null pointer
constant.

We have a NULL macro for this very purpose, use it.

There is also some interest in actually deprecating the use of 0 as a
null pointer constant in C.

This was found with -Wzero-as-null-pointer-constant which was enabled
for C in GCC 15 (not enabled with Wall or Wextra... yet).

Link: &lt;https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: create threads in detached state.</title>
<updated>2016-08-15T12:52:04+00:00</updated>
<author>
<name>Piotr Sikora</name>
<email>piotrsikora@google.com</email>
</author>
<published>2016-08-15T12:52:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=14b1b6e10a75994a6001a3480901e62f43e05696'/>
<id>14b1b6e10a75994a6001a3480901e62f43e05696</id>
<content type='text'>
This prevents theoretical resource leak, since those threads are never joined.

Found with ThreadSanitizer.

Signed-off-by: Piotr Sikora &lt;piotrsikora@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This prevents theoretical resource leak, since those threads are never joined.

Found with ThreadSanitizer.

Signed-off-by: Piotr Sikora &lt;piotrsikora@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: memory barriers in task completion notifications.</title>
<updated>2016-04-19T14:18:28+00:00</updated>
<author>
<name>Maxim Dounin</name>
<email>mdounin@mdounin.ru</email>
</author>
<published>2016-04-19T14:18:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=eeb72127cf4b86cb57f53e1f4702bbd1edd1a04a'/>
<id>eeb72127cf4b86cb57f53e1f4702bbd1edd1a04a</id>
<content type='text'>
The ngx_thread_pool_done object isn't volatile, and at least some
compilers assume that it is permitted to reorder modifications of
volatile and non-volatile objects.  Added appropriate ngx_memory_barrier()
calls to make sure all modifications will happen before the lock is released.

Reported by Mindaugas Rasiukevicius,
http://mailman.nginx.org/pipermail/nginx-devel/2016-April/008160.html.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ngx_thread_pool_done object isn't volatile, and at least some
compilers assume that it is permitted to reorder modifications of
volatile and non-volatile objects.  Added appropriate ngx_memory_barrier()
calls to make sure all modifications will happen before the lock is released.

Reported by Mindaugas Rasiukevicius,
http://mailman.nginx.org/pipermail/nginx-devel/2016-April/008160.html.
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: implemented graceful exiting of threads.</title>
<updated>2015-03-23T14:51:21+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2015-03-23T14:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=e87a565aab4da7ade1f016c2bab4371a70998974'/>
<id>e87a565aab4da7ade1f016c2bab4371a70998974</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: removed unused pointer to memory pool.</title>
<updated>2015-03-23T14:51:21+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2015-03-23T14:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=510c9cdca8368667a52a9710b38fe477f9c0d0e9'/>
<id>510c9cdca8368667a52a9710b38fe477f9c0d0e9</id>
<content type='text'>
No functional changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No functional changes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: keep waiting tasks mutex in ngx_thread_pool_t.</title>
<updated>2015-03-23T14:51:21+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2015-03-23T14:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=cb43696e0cb15cf063e475e8bd07a53a52775e2e'/>
<id>cb43696e0cb15cf063e475e8bd07a53a52775e2e</id>
<content type='text'>
It's not needed for completed tasks queue since the previous change.

No functional changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's not needed for completed tasks queue since the previous change.

No functional changes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: replaced completed tasks queue mutex with spinlock.</title>
<updated>2015-03-23T14:51:21+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2015-03-23T14:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=f109a68b4f5bfe976cb3ad45baab0de06b6c577b'/>
<id>f109a68b4f5bfe976cb3ad45baab0de06b6c577b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: silence warning on process exit.</title>
<updated>2015-03-19T20:20:18+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2015-03-19T20:20:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=c34368715f9e6639f11e9c1a70272668085d6886'/>
<id>c34368715f9e6639f11e9c1a70272668085d6886</id>
<content type='text'>
Work around pthread_cond_destroy() and pthread_mutex_destroy() returning
EBUSY.  A proper solution would be to ensure all threads are terminated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Work around pthread_cond_destroy() and pthread_mutex_destroy() returning
EBUSY.  A proper solution would be to ensure all threads are terminated.
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: fixed the waiting tasks accounting.</title>
<updated>2015-03-19T10:00:48+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2015-03-19T10:00:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=afe1fcffaae50a0b56555635c9b4debba0ee72df'/>
<id>afe1fcffaae50a0b56555635c9b4debba0ee72df</id>
<content type='text'>
Behave like POSIX semaphores.  If N worker threads are waiting for tasks,
at least that number of tasks should be allowed to be put into the queue.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Behave like POSIX semaphores.  If N worker threads are waiting for tasks,
at least that number of tasks should be allowed to be put into the queue.
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread pools: keep waiting tasks counter in ngx_thread_pool_t.</title>
<updated>2015-03-19T20:19:35+00:00</updated>
<author>
<name>Ruslan Ermilov</name>
<email>ru@nginx.com</email>
</author>
<published>2015-03-19T20:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=20d07074e3d1cd9069fd786aa4861a51a44f45b5'/>
<id>20d07074e3d1cd9069fd786aa4861a51a44f45b5</id>
<content type='text'>
It's not needed for completed tasks queue.

No functional changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's not needed for completed tasks queue.

No functional changes.
</pre>
</div>
</content>
</entry>
</feed>
