3 ms·
But what if you have more than one child/grandchildren/siblings. Each parent+child pair would need their own MAP_SHARED+MAP_PRIVATE pair. I'm not sure if this
by daurnimator 11y ago
But what if you have more than one child/grandchildren/siblings.
Each parent+child pair would need their own MAP_SHARED+MAP_PRIVATE pair.
I'm not sure if this is workable...
- geocar 11y agoNo they don't. 2 pages are used for each child that needs a random number from the shared seed, during the scope of the parent needing the seed. This is insignificant, and one of the pages can contain the seed. The Right Thing is to have a "prng_init()" routine, since the program that fork()s will know what it needs to do.