[PATCH 3/4] restart thread safety: remove malloc from genstack

Oren Laadan orenl at cs.columbia.edu
Fri Jul 30 11:57:36 PDT 2010


Matt Helsley wrote:
> On Fri, Jul 30, 2010 at 01:08:32PM -0400, Oren Laadan wrote:
>> We use clone and eclone directly and not through glibc, therefore
>> must explicitly care about thread-safety of malloc.
>>
>> This patch eliminates the use of malloc() in genstack_alloc().
>> Use mmap() instead. While an overkill, I don't expect performance
>> issues of this.
> 
> Should work so long as we know the glibc mmap wrappers themselves are
> reentrant/thread-safe. I expect they are but this might be a good thing
> to confirm.

True. And that goes for every system call we use in there -
including, for example, setsid().

One alternative is to call all those syscall directly using
the syscall() syscall. Not sure it's worth our time now, though.

Oren.


More information about the Containers mailing list