Re: feature tests for pthreads implementation and configuration?



In article <442A5B01.98A1333F@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Kasper Dupont <31026663590054698937@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Mikael Pettersson wrote:

We have considered over-sized stacks, but their increased memory
consumption characteristics make them less appealing than alt
stacks for us.

But what difference in memory usage do you get from allocating
x KB larger stack for each thread or allocating an x KB alternate
stack for each thread?

A lot, since they are not the same kinds of threads.

The language is heavily process (aka thread) oriented, and
process creation/deletion/usage needs to be as light-weight
as possible. The runtime system has been around for quite a
while, and it portable to all major Unixy OSes as well as
some embedded ones. Application-level processes are mapped
to internal "process" objects, which are scheduled by internal
schedulers and executed as native (JIT) code or by an interpreter.
So process != posix thread, and the number of processes is a lot
larger than the number of posix threads one can reasonably use.

In the multithreaded runtime system we're creating a smallish
number of scheduler threads (posix), each of which will handle
and execute a much larger number of language-level processes.
Each process has a small compiler-controlled stack for JIT
code, and each scheduler thread has an alt stack for signals.
--
Mikael Pettersson (mikpe@xxxxxxxxx)
Computing Science Department, Uppsala University
.