The maximum penalty the thread can receive is now limited depending on
the real thread priority. However, since it make it possible to starve
threads with priority lower than that limit. To prevent that threads
that have already earned the maximum penalty are periodically forced
to yield CPU to all other threads.
Until now, when the thread has been preempted by higher priority
thread it was then placed at the end of its priority FIFO and given
a new time slice. This patch changes it allowing the thread to
complete its time slice (when the higher priority threads are done),
unless there was very little time left in which case this time is added
to the next time slice.
Apart from making the algorithm more fair this change allows to identify
CPU bound threads more easily. (Earlier they could 'hide' by being
preempted by higher priority thread and consequently never using
their whole time slice).
This patch appears to fix#8007.
Thread that consume its whole quantum has its priority reduced. The penalty
is cancelled when the thread voluntarily gives up CPU. Real-time threads
are not affected.
The problem of thread starvation is not solved completely. The worst case
latency is still unbounded (even in systems with bounded number of threads).
When a middle priority thread is constantly preempted by high priority
threads it would not earn the penalty, thus the lower priority threads
still can be starved. Moreover, the punishment is probably too aggressive
as it reduces priority of virtually all CPU bound threads to 1.
* This was a script relying on a working /etc/profile, which may not be
there
* Instead, use GNU which, available as an haikuport recipe
* Since the command does not seem to be needed for Haiku to run (and
also because I don't know how to do it), GNU which isn't in the default
install.
* Typing "which" in a terminal still works, as that uses an alias
defined directly in /etc/profile.
Since we are using libraries originally intendent for user mode in kernel
mode providing them with some userland functions is inevitable. This
particular patch is to make zlib happy and able to call exit() when
its debug assertions fails.
This is a step towards fixing #10042.
When DEBUG is set BReferenceable::~BReferenceable() performs some checks
ensuring that the object is destroyed correctly. These checks require
information on thread stack, which is obtained by get_thread_info().
_get_thread_info() stub is added (actually, readded) which always returns
B_ERROR. Moreover, the check in BReferenceable destructor is modified
so that it does not fail when get_thread_info() fails.
- PackageManager: Adjust progress listener interface to also supply
the package name to the hook. Adjust implementors.
- PackageActions now get a pointer to the model. InstallPackageAction
uses that to resolve the package name given in the download progress hook
to the package currently being downloaded, and updates progress accordingly.
Consequently, if one requests installation of a package that has dependencies,
Depot now correctly updates the download progress status of those
accordingly, rather than updating the original package repeatedly.
Looks like I was too quick on previous commit.
It seems -pthread is actually not that much needed on Linux though...
although the manpage says "compile and link with -pthread". Go figure.
Now dlopen() uses RTLD_LAZY | RTLD_LOCAL for Linux, which seems
to work here.
Declare a HOST_PTHREAD_LINKFLAGS variable to hold the flags
required to link with pthreads, and use it for the solver addon.
Works on GNU/Linux, please test and fix for other platforms.
* only the source package are actually relevant, as the source paths
within older versions of those source packages no longer match the
expectations of the build system
Previous implementation used weak symbols on all platforms except Haiku. Mac OS X also does not support this use of weak symbols. In the discussion of #10028 it was decided that probably more platforms will have problems with this approach, so instead use the approach that always works.