[Shootout-list] Re: process creation
Bengt Kleberg
bengt.kleberg@ericsson.com
Mon, 01 Nov 2004 11:59:14 +0100
greetings,
i have updated the about-this-test for process creation. the original
text has been keept unchanged if possible. please let me know if things
are unclear, and/or should be changed for the better.
About this test
For this test, each program should be implemented to do the same thing.
This test measures the speed of process (or thread) instantiation. In
theory, a CO (Concurrency Oriented) language will have superior
performance in this test. Let's see if our theory holds up!
This test has been designed to allow the number of simultaneous
processes to grow with N. The purpose of this is to see how the timings
changes as the number of processes increase.
After the process is created we want to make sure that it is actually up
and running. So the job of creating the next process is given to the new
process. Then the creating process should wait on/for an event of some
kind. The actual event does not matter -- it could be a condition
variable, a semaphore, an e-mail, whatever. The important thing is that
it is an individual event, so that this particular process can be told
to continue its execution without disturbing the other processes in this
test. It is not allowed to use an event that will never be possible
because some languages will notice this and garbage collect the prcocess.
The test program should take one argument, N, which is the number of
processes to create.
The correct output, after all processes have been created, is N.
The algorithm for each process shall be as follows:
1. if we have created all processes then print the number of
processes and stop.
2. if not, create a new process.
3. finally wait for something that can happen.
bengt