<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libc/include, branch OPENBSD_7_8_BASE</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_8_BASE</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_8_BASE'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2025-08-04T01:44:33+00:00</updated>
<entry>
<title>replace the flockfile backend with a per FILE recursive mutex.</title>
<updated>2025-08-04T01:44:33+00:00</updated>
<author>
<name>dlg</name>
<email></email>
</author>
<published>2025-08-04T01:44:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=97f291299e43eb39dd2ecdc18098d938d467dac6'/>
<id>urn:sha1:97f291299e43eb39dd2ecdc18098d938d467dac6</id>
<content type='text'>
the flockfile implementation in thread/rthread_file.c used an
external lock, and associated it with the relevant FILE * as needed.
this isn't great for a lot of reasons, complexity being the big
one, but the straw that broke the camels back is that it uses a
single spinlock to coordinate all of this, which in turn generates
a lot of sched_yield syscalls.

this avoids all the code complexity and the spinlock by just embedding
a small __rctmx in every FILE.

tested by and ok tb@ jca@
ok claudio@
</content>
</entry>
<entry>
<title>This thread-aware profiling support diff comes from Yuichiro NAITO.</title>
<updated>2025-07-16T16:22:58+00:00</updated>
<author>
<name>deraadt</name>
<email></email>
</author>
<published>2025-07-16T16:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5506a044dc35162b58584a83a4099b4268ceba2a'/>
<id>urn:sha1:5506a044dc35162b58584a83a4099b4268ceba2a</id>
<content type='text'>
At runtime, profiling data is stored per-thread.  Upon termination, the
per-thread profiling data pools are merged into a into a single record,
which is then written out (using the new kernel-assisted system).  I think
the original gmon merging parts may have come from or been inspired by
someone at NetBSD.
This has been delayed because there were concerns about adding a TLS object
which would require other library cranks, so this rides all the major cranks
today.
ok kettenis tb claudio sthen etc etc etc
</content>
</entry>
<entry>
<title>add libc specific __cmtx and __rcmtx locks for internal use.</title>
<updated>2025-07-12T23:59:44+00:00</updated>
<author>
<name>dlg</name>
<email></email>
</author>
<published>2025-07-12T23:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=417b1213b262bbe6d34c708537dff4b062920bfa'/>
<id>urn:sha1:417b1213b262bbe6d34c708537dff4b062920bfa</id>
<content type='text'>
__cmtx provides mutual exclusion using futex(2) and cas on archs
that support it, or _spinlocks on the rest. __rcmtx is a recursive
mutex built on top of __cmtx, so it inherits the use of futex and
cas/spinlock from __cmtx.

until now the options we had for locking between threads in libc
were spinlocks or pthread mutexes. spinlocks use sched_yield to
relax if they have to spin on a contended lock, which we are trying
to minimise the use of as much as possible. pthread_mutex is
relatively large in memory and offers a lot of complicated features
which are unecessary for most of libc. the non cas/futex version
of pthread_mutexes currently relies on __thrsleep and __thrwakeup,
which we also want to deprecate.

having a small futex based lock available everywhere will help us
move away from overuse of spinlocks, and deprecate __thrsleep and
__thrwakeup.

ok kettenis@
jca@ provided his eyes too.
</content>
</entry>
<entry>
<title>Use struct __sFILE instead of FILE in thread locking callback</title>
<updated>2024-08-18T02:25:51+00:00</updated>
<author>
<name>guenther</name>
<email></email>
</author>
<published>2024-08-18T02:25:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=01a2985a38a3c808144fed57b482f1147af4d183'/>
<id>urn:sha1:01a2985a38a3c808144fed57b482f1147af4d183</id>
<content type='text'>
declarations to reduce &lt;stdio.h&gt; pollution.  Declare __isthreaded
in thread_private.h where it's really needed.

ok deraadt@
</content>
</entry>
<entry>
<title>Enable ISO C11 APIs when building libc, even with an older compiler.</title>
<updated>2023-10-29T14:26:13+00:00</updated>
<author>
<name>millert</name>
<email></email>
</author>
<published>2023-10-29T14:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0818a58d9b3218e98640cc0b19181d9015c432ea'/>
<id>urn:sha1:0818a58d9b3218e98640cc0b19181d9015c432ea</id>
<content type='text'>
Otherwise, the prototypes for timespec_get() and aligned_alloc()
are not visible.  OK guenther@
</content>
</entry>
<entry>
<title>Update to reflect changes over the last six years</title>
<updated>2021-12-25T01:13:44+00:00</updated>
<author>
<name>guenther</name>
<email></email>
</author>
<published>2021-12-25T01:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=53c5e2cba9eff61f67c99cd18ea5209d02611f16'/>
<id>urn:sha1:53c5e2cba9eff61f67c99cd18ea5209d02611f16</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix two issues related to thread private data in asr.</title>
<updated>2021-01-06T19:54:17+00:00</updated>
<author>
<name>otto</name>
<email></email>
</author>
<published>2021-01-06T19:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a99f91343a365d71d137ae486285fdf049c5cf74'/>
<id>urn:sha1:a99f91343a365d71d137ae486285fdf049c5cf74</id>
<content type='text'>
- setting up asr in single thread mode and then starting threads using asr
  would lead to multiple threads sharing the same resolver.
- destruction of a thread that has been using asr would leak data.
Problem originally reported by Alexey Sokolov and Uli Schlachter.
ok kettenis@
</content>
</entry>
<entry>
<title>gcc3, like clang and unlike our gcc4, doesn't support redirecting builtins</title>
<updated>2019-11-25T22:57:28+00:00</updated>
<author>
<name>guenther</name>
<email></email>
</author>
<published>2019-11-25T22:57:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=dbf2b9876db143d9320fa3f1b2b0d9e451c964c0'/>
<id>urn:sha1:dbf2b9876db143d9320fa3f1b2b0d9e451c964c0</id>
<content type='text'>
like mem{set,cpy,move} or __stack_smash_handler using asm() renaming.  So
treat gcc3 like clang and mark such functions as protected instead.

ok ayoma@
</content>
</entry>
<entry>
<title>Complete the ld.so boot cleanup: move most libc initialization from</title>
<updated>2019-06-02T01:03:01+00:00</updated>
<author>
<name>guenther</name>
<email></email>
</author>
<published>2019-06-02T01:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a6e675c6e949db993e297cb4af8780a6a40a5b9c'/>
<id>urn:sha1:a6e675c6e949db993e297cb4af8780a6a40a5b9c</id>
<content type='text'>
_csu_finish() to _libc_preinit(), which is an .init_array function
in shared libc (and mark it INITFIRST) or a .preinit_array function
in static libc, grabbing the _dl_cb callback there from ld.so.  Then
in _csu_finish(), invoke the dl_clean_boot() callback to free ld.so's
startup bits before main() gets control.

Other cleanups this permits:
 - move various startup structures into .data.rel.ro
 - the dl* stubs in libc can be strong and call the callbacks provided
   via _dl_cb
 - no longer need to conditionalize dlctl() calls on presence of _DYNAMIC

original concept and full diff ok kettenis@
ok deraadt@
</content>
</entry>
<entry>
<title>Move 'how this works' details from namespace.h to DETAILS</title>
<updated>2019-05-13T20:00:32+00:00</updated>
<author>
<name>guenther</name>
<email></email>
</author>
<published>2019-05-13T20:00:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=cbcc12d4538b785f730b753915a6885e7c6a4601'/>
<id>urn:sha1:cbcc12d4538b785f730b753915a6885e7c6a4601</id>
<content type='text'>
</content>
</entry>
</feed>
