summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_concurrency.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow the concurrency level to be reduced.Daniel Eischen2003-08-301-28/+54
| | | | | | | Reviewed by: davidxu Notes: svn path=/head/; revision=119577
* Rethink the MD interfaces for libpthread to account forDaniel Eischen2003-08-051-1/+1
| | | | | | | | | | | | archs that can (or are required to) have per-thread registers. Tested on i386, amd64; marcel is testing on ia64 and will have some follow-up commits. Reviewed by: davidxu Notes: svn path=/head/; revision=118510
* sysctlbyname needs size_t type, not int.David Xu2003-07-311-1/+1
| | | | Notes: svn path=/head/; revision=118254
* o Eliminate upcall for PTHREAD_SYSTEM_SCOPE thread, now itDavid Xu2003-07-171-1/+1
| | | | | | | | | | | | | | | | is system bound thread and when it is blocked, no upcall is generated. o Add ability to libkse to allow it run in pure 1:1 threading mode, defining SYSTEM_SCOPE_ONLY in Makefile can turn on this option. o Eliminate code for installing dummy signal handler for sigwait call. o Add hash table to find thread. Reviewed by: deischen Notes: svn path=/head/; revision=117706
* Change low-level locking a bit so that we can tell ifDaniel Eischen2003-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=115278
* o Don't add a scope system thread's KSE to the list of availableDaniel Eischen2003-04-281-45/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <sys/kse.h>. 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. Notes: svn path=/head/; revision=114187
* Add a working pthread_[gs]etconcurrency. Initial null implementationDaniel Eischen2003-04-221-0/+120
provided by Sergey A. Osokin <osa@freebsd.org.ru>. In order to test this on a single CPU machine, you need to: sysctl kern.threads.debug=1 sysctl kern.threads.virtual_cpu=2 Notes: svn path=/head/; revision=113871