Possible race (FiascoOC) signalling?

Norman Feske norman.feske at ...1...
Fri Jul 29 13:45:25 CEST 2011

Hi Daniel,

I am not able to reproduce the problem using Genode's SVN head and
Fiasco.OC (tested with both revisions 31 and 36). I get the following

 int main(): --- create local services ---
 int main(): --- start init ---
 int main(): transferred 56 MB to init
 int main(): --- init created, waiting for exit condition ---
 [init -> test-daniel] Starting ldso ...
 [init -> test-daniel] Starting application ... environ: 1058
 [init -> test-daniel] Test::Pager::Pager(): Pager constructed OK.
 [init -> test-daniel] Test-pager-2 example. ;-))
 [init -> test-daniel] Test::SharedMemory::SharedMemory(): About to
start the pager.
 [init -> test-daniel] Test::SharedMemory::SharedMemory(): About to
attach to vaddr (0x0)
 [init -> test-daniel] Test::SharedMemory::SharedMemory(): Attached
dataspace to vaddr (0xfff000)
 [init -> test-daniel] shmem created ok.

Looks ok to me. If in doubt about the construction time of the '_pager'
object, I suggest constructing the object using a function with a local
static variable:

 Test::Pager *pager() {
   static Test:Pager instance;
   return &instance;

This way, 'instance' is constructed at the first call of 'pager()'. So
you have much better control over the time of construction. As a nice
side effect, the execution order of constructors (if global objects
depend on each other) becomes correct by definition. For this reason, we
usually avoid the use of global constructors altogether.


Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

More information about the users mailing list