Re: Containers and threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




--On 30 April 2011 11:05:21 +0100 Alex Bligh <alex@xxxxxxxxxxx> wrote:

> Is it possible for a process to have 2 threads, one of which does
> unshare(CLONE_NEWNET), but for them to be sharing the same memory
> space, and with the unsharing one doing fork() occasionally?

For future readers, the answer to this question is "yes", and if
you are doing things with 2 namespaces active, it's remarkably easy.

What you do need to know is to use the gettid() system call (no
glibc wrapper) to get the system tid (not pthreads tid) to as
the target to move interfaces between namespaces etc.

-- 
Alex Bligh
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers


[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux