Scientific Operations Bellum Gratia Artis

testing - 2015 - September - this message

[ previous , next ]

Subject: Re: [9fans] Privalloc(2) and rfork(RFPROC|RFMEM) (was: a pair nec

From: erik quanstrom <quanstro@[REDACTED]>
Date: Sat, 5 Sep 2015 11:47:17 -0700

> May be my problem is that p is global in my case?

global variables are in the bss, and thus shared. p will have
the same value in each thread, but *p should point into the
stack, and thus the same virtual address will be mapped to
different physical pages of memory.

however, if *p is assigned to a non-zero value before the process
is created, the new page allocated for the new process' stack will
have a copy of the old value, and thus not be 0.

- erik