<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-openbsd/lib/librthread/Makefile, branch master</title>
<subtitle>WireGuard implementation for the OpenBSD kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-openbsd/atom/lib/librthread/Makefile?h=master</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-openbsd/atom/lib/librthread/Makefile?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/'/>
<updated>2020-02-06T03:13:45Z</updated>
<entry>
<title>Instead of opting in to futexes on archs with atomics opt out on archs</title>
<updated>2020-02-06T03:13:45Z</updated>
<author>
<name>jsg</name>
<email>jsg@openbsd.org</email>
</author>
<published>2020-02-06T03:13:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2ee00db36bd4c31e23829424e9f44f4dbb4646f4'/>
<id>urn:sha1:2ee00db36bd4c31e23829424e9f44f4dbb4646f4</id>
<content type='text'>
without atomics, a smaller list.

ok mpi@ visa@
</content>
</entry>
<entry>
<title>New futex(2) based rwlock implementation based on the mutex code.</title>
<updated>2019-02-13T13:22:14Z</updated>
<author>
<name>mpi</name>
<email>mpi@openbsd.org</email>
</author>
<published>2019-02-13T13:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=5ecdd0566b441ae0b99e73f410875e05dc0fa5b7'/>
<id>urn:sha1:5ecdd0566b441ae0b99e73f410875e05dc0fa5b7</id>
<content type='text'>
This implementation reduces contention because threads no longer need
to spin calling sched_yield(2) before going to sleep.

Tested by many, thanks!

ok visa@, pirofti@
</content>
</entry>
<entry>
<title>Move sigwait(3) from libpthread to libc</title>
<updated>2019-01-12T00:16:03Z</updated>
<author>
<name>jca</name>
<email>jca@openbsd.org</email>
</author>
<published>2019-01-12T00:16:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=13e54a3ce65615faaf13e4717a510eb52bfb2efe'/>
<id>urn:sha1:13e54a3ce65615faaf13e4717a510eb52bfb2efe</id>
<content type='text'>
POSIX wants it in libc, that's where the function can be found on other
systems.  Reported by naddy@, input from naddy@ and guenther@.
"looks ok" guenther@, ok deraadt@

Note: riding the libc/libpthread major cranks earlier today.
</content>
</entry>
<entry>
<title>Switch alpha to futex(2) based condvars, mutexes and semaphores.</title>
<updated>2018-10-21T17:07:24Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2018-10-21T17:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=2b819b9469dd1b5852b324ae10fcffed47a792b5'/>
<id>urn:sha1:2b819b9469dd1b5852b324ae10fcffed47a792b5</id>
<content type='text'>
From Brad, tested by Miod, OK kettenis@
</content>
</entry>
<entry>
<title>Switch powerpc to futex(2) based condvars, mutexes and semaphores.</title>
<updated>2018-10-15T13:03:11Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2018-10-15T13:03:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=94fcb5388a8e944153fb2d66d69e156cf67adf78'/>
<id>urn:sha1:94fcb5388a8e944153fb2d66d69e156cf67adf78</id>
<content type='text'>
From Brad, OK mpi@ kettenis@
</content>
</entry>
<entry>
<title>enable futex(2) based mutexes on armv7 and use futex based semaphores in</title>
<updated>2018-09-24T11:25:09Z</updated>
<author>
<name>jsg</name>
<email>jsg@openbsd.org</email>
</author>
<published>2018-09-24T11:25:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=e9c926da912f1985b3a00df6995af59a26881ef3'/>
<id>urn:sha1:e9c926da912f1985b3a00df6995af59a26881ef3</id>
<content type='text'>
librthread on armv7 as well
from brad ok visa@ kettenis@ mpi@
</content>
</entry>
<entry>
<title>New semaphore implementation making sem_post async-safe.</title>
<updated>2018-06-08T13:53:01Z</updated>
<author>
<name>pirofti</name>
<email>pirofti@openbsd.org</email>
</author>
<published>2018-06-08T13:53:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=4b11781bee459297183dc7fc1d9191404fa83c4a'/>
<id>urn:sha1:4b11781bee459297183dc7fc1d9191404fa83c4a</id>
<content type='text'>
POSIX dictates that sem_post() needs to be async-safe here[0] and is
thus included in the list of safe functions to call from within a signal
handler here[1].

The old semaphore implementation is using spinlocks and __thrsleep to
synchronize between threads.

Let's say there are two threads: T0 and T1 and the semaphore has V=0.
T1 calls sem_wait() and it will now sleep (spinlock) until someone else
sem_post()'s. Let's say T0 sends a signal to T1 and exits.
The signal handler calls sem_post() which is meant to unblock T1 by
incrementing V. With the old semaphore implementation we we are now in a
deadlock as sem_post spinlocks on the same lock.

The new implementation does not suffer from this defect as it
uses futexes to resolve locking and thus sem_post does not need to spin.
Besides fixing this defect and making us POSIX compliant, this should
also improve performance as there should be less context switching and
thus less time spent in the kernel.

For architectures that do not provied futexes and atomic operations,
the old implementation will be used and it is now being renamed to
rthread_sem_compat as discussed with mpi@.

[0] -- http://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_post.html
[1] -- http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

OK visa@, mpi@, guenther@
</content>
</entry>
<entry>
<title>Move the thread-related .h files to /usr/src/include/, since the</title>
<updated>2017-10-15T23:40:33Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2017-10-15T23:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=249f38f2da514405bb27d05caf81ae636ba2a4f5'/>
<id>urn:sha1:249f38f2da514405bb27d05caf81ae636ba2a4f5</id>
<content type='text'>
implementation is now spread between libc and librthread.  No changes
to the content

ok mpi@
</content>
</entry>
<entry>
<title>Move mutex, condvar, and thread-specific data routes, pthread_once, and</title>
<updated>2017-09-05T02:40:54Z</updated>
<author>
<name>guenther</name>
<email>guenther@openbsd.org</email>
</author>
<published>2017-09-05T02:40:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=a5511fa9f431600dbd6dc2b46fc4e6b73e7d239c'/>
<id>urn:sha1:a5511fa9f431600dbd6dc2b46fc4e6b73e7d239c</id>
<content type='text'>
pthread_exit from libpthread to libc, along with low-level bits to
support them.  Major bump to both libc and libpthread.

Requested by libressl team.  Ports testing by naddy@
ok kettenis@
</content>
</entry>
<entry>
<title>Enable the use of futex(2) in librthread on mips64.</title>
<updated>2017-07-04T14:33:43Z</updated>
<author>
<name>visa</name>
<email>visa@openbsd.org</email>
</author>
<published>2017-07-04T14:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-openbsd/commit/?id=03ef7681b631b84ad7903a6fc274e25097ec2ea8'/>
<id>urn:sha1:03ef7681b631b84ad7903a6fc274e25097ec2ea8</id>
<content type='text'>
OK mpi@, deraadt@
</content>
</entry>
</feed>
