Major overhaul to the way thread startup and exit is done. Removes some
ugly gunk in the scheduler, and adds support for thread detaching and
cancellation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@326
$ nm /lib/libc-2.2.4.so | grep vfork
000b4220 T __vfork
000b4220 W vfork
There's no __libc_vfork, so there's nothing we can do here.
Just don't supply our own version.
Not at all sure if this is correct.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@303
throw away the old signals simulation and more or less start again
from scratch. vg_signals.c is nearly a complete rewrite. In fact
this is now the third generation of the signals simulation.
The purpose of this is to properly support signals in threads -- a
nightmare combination. pthread_sigmask, pthread_kill and sigwait
are now alledged to work as POSIX requires.
In the process, throw away confusing and conceptually muddled old
implementation and replace with something which is more verbose but
conceptually cleaner, simpler and easier to argue is correct.
* When the client does sigaction/sigprocmask et al, the resulting
changes are stored verbatim in SCSS -- the Static Client Signal State.
So SCSS is the state the client believes the kernel is in.
* Every time SCSS changes, we recalculate the state the kernel
*should* be in so that our signal simulation works. This is the
SKSS -- Static Kernel Signal State. The kernel state is then
updated accordingly. By diffing the new and old SKSSs, the
number of real system calls made is minimised.
* The dynamic state of the client's signals is stored in DCSS
-- Dynamic Client Signal State. This just records which signals
are pending for which threads.
The big advantage of this scheme over the previous is that the SCSS ->
SKSS mapping is made explicit and gathered all in one place, rather
than spread out in a confusing way and done implicitly. That makes it
all lot easier to decide if the mapping, which is really the heart of
the signals simulation, is correct or not.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@271
will start up valgrind if it is not already running. This more or less
sidesteps the problem that sometimes valgrind.so isn't init'd first by
the dynamic linker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@257
poll(). After this change, Mozilla-0.9.2.1 and Galeon 0.11.3 finally
behave reasonably on my box.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@165
of the real libpthread.so. This is a Good Thing, despite the fact it
temporarily breaks some threaded programs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@153
by the real libpthread.so. In the process fix a bunch of stuff, including
adding thread-specific h_errno and resolver state storage. This fixes
licq crashing at startup.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@149
it has tremendous performance problems.
* Implement pthread_key_{create,delete} and pthread_{set,get}specific.
* Implement pthread_cond_timedwait. A nuisance.
* New timer infrastructure, based on the RDTSC instruction. This
allows fast, accurate time measurement without swamping the host with
gettimeofday() syscalls.
There's something definitely screwy about the scheduler, making opera
run slowly and mozilla run unbelievably slowly. To be investigated.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@119
when running multithreaded. Can still cause crashes (assertion failures)
when GDB exits. I think it that's due to my use of libc's system()
call; should roll my own.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@111
Fall back to a compromise position, which makes my mutex implementation
initialiser- and structure-compatible with LinuxThreads, and ditto the
upcoming condition var implementation. In particular this means that
((ThreadId)0) is an invalid thread ID, so vg_threads[0] is never used,
and vg_threads[1] specially denotes the "main" thread.
Remove the scheme of having a linked list of threads waiting on
each mutex. It is too difficult to get the right semantics for
when a signal is delivered to a thread blocked in pthread_mutex_lock().
Instead, use the old scheme of each thread stating with its .waited_on_mx
field, which mutex it is waiting for. This makes pthread_mutex_unlock()
less efficient, but at least it all works.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@100
for implementation of condition variables.
* Use the native pthread_mutex_t directly; we no longer have our own
VgMutex type nor a fixed array of them.
* Give ThreadState a new field q_next :: ThreadId, used to make a
linked list of threads waiting on a mutex, or condition variable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@99