<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test2/lib/libpthread/thread/thr_cond.c, branch release/5.1.0_cvs</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F5.1.0_cvs</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test2/atom?h=release%2F5.1.0_cvs'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/'/>
<updated>2003-06-04T16:00:27Z</updated>
<entry>
<title>This commit was manufactured by cvs2svn to create tag</title>
<updated>2003-06-04T16:00:27Z</updated>
<author>
<name>cvs2svn</name>
<email>cvs2svn@FreeBSD.org</email>
</author>
<published>2003-06-04T16:00:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=1c0442969cd576514acfce932c0a0798593c7af7'/>
<id>urn:sha1:1c0442969cd576514acfce932c0a0798593c7af7</id>
<content type='text'>
'RELENG_5_1_0_RELEASE'.

This commit was manufactured to restore the state of the 5.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
</content>
</entry>
<entry>
<title>MFC: Free internal low level lock's memory.</title>
<updated>2003-06-04T01:01:18Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2003-06-04T01:01:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=97ed5fe141a907f6db0406c7a5474ef00ed840d9'/>
<id>urn:sha1:97ed5fe141a907f6db0406c7a5474ef00ed840d9</id>
<content type='text'>
Approved by:	re (scottl)
</content>
</entry>
<entry>
<title>Attempt to eliminate PLT relocations from rwlock aquire/release</title>
<updated>2003-05-30T00:21:52Z</updated>
<author>
<name>Alexander Kabaev</name>
<email>kan@FreeBSD.org</email>
</author>
<published>2003-05-30T00:21:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=84d55c7fad83f4fa1330cc8c2206da8ebd0b300d'/>
<id>urn:sha1:84d55c7fad83f4fa1330cc8c2206da8ebd0b300d</id>
<content type='text'>
path, making them suitable for direct use by the dynamic loader.

Register libpthread-specific locking API with rtld on startup.

This still has some rough edges with signals which should be
addresses later.

Approved by:	re (scottl)
</content>
</entry>
<entry>
<title>Change low-level locking a bit so that we can tell if</title>
<updated>2003-05-24T02:29:25Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-05-24T02:29:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=1cb570c53190e8b569091f708781c6bf9c3126c7'/>
<id>urn:sha1:1cb570c53190e8b569091f708781c6bf9c3126c7</id>
<content type='text'>
a lock is being waitied on.

Fix a races in join and cancellation.

When trying to wait on a CV and the library is not yet
threaded, make it threaded so that waiting actually works.

When trying to nanosleep() and we're not threaded, just
call the system call nanosleep instead of adding the thread
to the wait queue.

Clean up adding/removing new threads to the "all threads queue",
assigning them unique ids, and tracking how many active threads
there are.  Do it all when the thread is added to the scheduling
queue instead of making pthread_create() know how to do it.

Fix a race where a thread could be marked for signal delivery
but it could be exited before we actually add the signal to it.

Other minor cleanups and bug fixes.

Submitted by:	davidxu
Approved by:	re@ (blanket for libpthread)
</content>
</entry>
<entry>
<title>Eek, staticize a couple of functions that shouldn't</title>
<updated>2003-05-19T23:04:50Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-05-19T23:04:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=28f318b94128e82f8052861c958525c930f7d77a'/>
<id>urn:sha1:28f318b94128e82f8052861c958525c930f7d77a</id>
<content type='text'>
be external (initialize()!).

Remove cancellation points from _pthread_cond_wait and
_pthread_cond_timedwait (single underscore versions are
libc private functions).  Point the weak reference(!) for
these functions to the versions with cancellation points.

Approved by:	re@(blanket till 5/19)
Pointed out by:	kan (cancellation point bug)
</content>
</entry>
<entry>
<title>Add a method of yielding the current thread with the scheduler</title>
<updated>2003-05-16T19:58:30Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-05-16T19:58:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=fd626336fd97bad05a86f02b646c66d2fe14d01a'/>
<id>urn:sha1:fd626336fd97bad05a86f02b646c66d2fe14d01a</id>
<content type='text'>
lock held (_thr_sched_switch_unlocked()) and use this to avoid
dropping the scheduler lock and having the scheduler retake the
same lock again.

Add a better way of detecting if a low-level lock is in use.

When switching out a thread due to blocking in the UTS, don't
switch to the KSE's scheduler stack only to switch back to
another thread.  If possible switch to the new thread directly
from the old thread and avoid the overhead of the extra
context switch.

Check for pending signals on a thread when entering the scheduler
and add them to the threads signal frame.  This includes some
other minor signal fixes.

Most of this was a joint effor between davidxu and myself.

Reviewed by:	davidxu
Approved by:	re@ (blanket for libpthread)
</content>
</entry>
<entry>
<title>Handle thread canceled case, it is same as signal caused backout,</title>
<updated>2003-05-02T11:39:00Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2003-05-02T11:39:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=99c883294c3de3f5a8385a30d18a2f20e1efa36e'/>
<id>urn:sha1:99c883294c3de3f5a8385a30d18a2f20e1efa36e</id>
<content type='text'>
but will break out of loop.
</content>
</entry>
<entry>
<title>o Don't add a scope system thread's KSE to the list of available</title>
<updated>2003-04-28T23:56:12Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-04-28T23:56:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=55613576f5c40d62fecb4ab76f012917fc399c3e'/>
<id>urn:sha1:55613576f5c40d62fecb4ab76f012917fc399c3e</id>
<content type='text'>
  KSEs when it's thread exits; allow the GC handler to do that.

o Make spinlock/spinlock critical regions.

The following were submitted by davidxu

  o Alow thr_switch() to take a null mailbox argument.

  o Better protect cancellation checks.

  o Don't set KSE specific data when creating new KSEs; rely on the
    first upcall of the KSE to set it.

  o Add the ability to set the maximum concurrency level and do this
    automatically.  We should have a way to enable/disable this with
    some sort of tunable because some applications may not want this
    to be the default.

  o Hold the scheduling lock across thread switch calls.

  o If scheduling of a thread fails, make sure to remove it from the list
    of active threads.

  o Better protect accesses to a joining threads when the target thread is
    exited and detached.

  o Remove some macro definitions that are now provided by &lt;sys/kse.h&gt;.

  o Don't leave the library in threaded mode if creation of the initial
    KSE fails.

  o Wakeup idle KSEs when there are threads ready to run.

  o Maintain the number of threads active in the priority queue.
</content>
</entry>
<entry>
<title>Add a couple asserts to pthread_cond_foo to ensure the (low-level)</title>
<updated>2003-04-22T20:28:33Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-04-22T20:28:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=6dee371a559db5d6bce5e827e6addf9b52bd4a0e'/>
<id>urn:sha1:6dee371a559db5d6bce5e827e6addf9b52bd4a0e</id>
<content type='text'>
lock level is 0.  Thus far, the threads implementation doesn't use
mutexes or condition variables so the lock level should be 0.

Save the return value when trying to schedule a new thread and
use this to return an error from pthread_create().

Change the max sleep time for an idle KSE to 1 minute from 2 minutes.

Maintain a count of the number of KSEs within a KSEG.

With these changes scope system threads seem to work, but heavy
use of them crash the kernel (supposedly VM bugs).
</content>
</entry>
<entry>
<title>Add an i386-specifc hack to always set %gs.  There still seems</title>
<updated>2003-04-21T04:02:56Z</updated>
<author>
<name>Daniel Eischen</name>
<email>deischen@FreeBSD.org</email>
</author>
<published>2003-04-21T04:02:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test2/commit/?id=02245e612089c10a31b75ebd58bbef4765fcc054'/>
<id>urn:sha1:02245e612089c10a31b75ebd58bbef4765fcc054</id>
<content type='text'>
to be instances where the kernel doesn't  properly save and/or
restore it.

Use noupcall and nocompleted flags in the KSE mailbox.  These
require kernel changes to work which will be committed sometime
later.  Things still work without the changes.

Remove the general kse entry function and use two different
functions -- one for scope system threads and one for scope
process threads.  The scope system function is not yet enabled
and we use the same function for all threads at the moment.

Keep a copy of the KSE stack for the case that a KSE runs
a scope system thread and uses the same stack as the thread
(no upcalls are generated, so a separate stack isn't needed).
This isn't enabled yet.

Use a separate field for the KSE waiting flag.  It isn't
correct to use the mailbox flags field.

The following fixes were provided by David Xu:

  o Initialize condition variable locks with thread versions
    of the low-level locking functions instead of the kse versions.

  o Enable threading before creating the first thread instead
    of after.

  o Don't enter critical regions when trying to malloc/free
    or call functions that malloc/free.

  o Take the scheduling lock when inheriting thread attributes.

  o Check the attribute's stack pointer instead of the
    attributes stack size for null when allocating a
    thread's stack.

  o Add a kseg reinit function so we don't have to destroy and
    then recreate the same lock.

  o Check the return value of kse_create() and return an
    appropriate error if it fails.

  o Don't forget to destroy a thread's locks when freeing it.

  o Examine the correct flags word for checking to see if
    a thread is in a synchronization queue.

Things should now work on an SMP kernel.
</content>
</entry>
</feed>
