From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Nadia Derbey <Nadia.Derbey-6ktuUTfB/bM@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Nick Andrew <nick-dnCCA748QAperShJXdIFYw@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC][PATCH 0/4] Object creation with a specified id
Date: Tue, 15 Apr 2008 14:52:33 -0400 [thread overview]
Message-ID: <4804F971.3020207@cs.columbia.edu> (raw)
In-Reply-To: <480483C2.3030509-6ktuUTfB/bM@public.gmane.org>
Nadia Derbey wrote:
> Nick Andrew wrote:
>> On Fri, Apr 04, 2008 at 04:51:29PM +0200, Nadia.Derbey-6ktuUTfB/bM@public.gmane.org wrote:
>>
>>> . echo "LONG XX" > /proc/self/next_id
>>> next object to be created will have an id set to XX
>>> . echo "LONG<n> X0 ... X<n-1>" > /proc/self/next_id
>>> next object to be created will have its ids set to XX0, ... X<n-1>
>>> This is particularly useful for processes that may have several
>>> ids if
>>> they belong to nested namespaces.
>>
>>
>> How do you handle race conditions, i.e. you specify the ID for the
>> next object to be created, and then some other thread goes and creates
>> an object before your thread creates one?
>>
>> Nick.
>
>
> Sorry for not answering earlier, I just saw your e-mail!
[I too managed to miss that message].
>
> It's true that the way I've done things, the "create_with_id" doesn't
> take into account multi-threaded apps, since "self" is related to the
> thread group leader.
>
> May be using something like /proc/self/task/<my_tid>/next_id would be
> better, but I have to think more about it...
That /proc/self links to /proc/TGID slipped my mind. Definitely must
be done on a per-thread basis (and /proc/<TGID>/task/<PID>/next_id
will do the trick).
Oren.
>
> Regards,
> Nadia
next prev parent reply other threads:[~2008-04-15 18:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080404145129.637145000@bull.net>
2008-04-04 14:51 ` [RFC][PATCH 1/4] Provide a new procfs interface to set next id Nadia.Derbey-6ktuUTfB/bM
2008-04-04 14:51 ` [RFC][PATCH 2/4] Provide a new procfs interface to set next upid nr(s) Nadia.Derbey-6ktuUTfB/bM
2008-04-04 14:51 ` [RFC][PATCH 3/4] IPC: use the target ID specified in procfs Nadia.Derbey-6ktuUTfB/bM
2008-04-04 14:51 ` [RFC][PATCH 4/4] PID: " Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080404145129.637145000-6ktuUTfB/bM@public.gmane.org>
2008-04-15 3:06 ` [RFC][PATCH 0/4] Object creation with a specified id Nick Andrew
[not found] ` <20080415030623.GA8171@tull.net>
[not found] ` <480483C2.3030509@bull.net>
[not found] ` <480483C2.3030509-6ktuUTfB/bM@public.gmane.org>
2008-04-15 18:52 ` Oren Laadan [this message]
[not found] ` <20080415030623.GA8171-ZRFfYzONFVA@public.gmane.org>
2008-04-15 10:30 ` Nadia Derbey
2008-04-18 5:46 ` Nadia Derbey
2008-04-04 14:51 Nadia.Derbey-6ktuUTfB/bM
-- strict thread matches above, loose matches on Subject: below --
2008-03-10 13:50 Nadia.Derbey-6ktuUTfB/bM
[not found] ` <20080310135054.312992000-6ktuUTfB/bM@public.gmane.org>
2008-03-13 23:16 ` Oren Laadan
[not found] ` <47D9B5B7.6060803-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14 6:21 ` Nadia Derbey
[not found] ` <47DA195B.8070704-6ktuUTfB/bM@public.gmane.org>
2008-03-14 15:50 ` Oren Laadan
[not found] ` <47DA9EB5.8040704-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14 15:56 ` Pavel Emelyanov
[not found] ` <47DAA041.9090009-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-03-14 16:02 ` Oren Laadan
[not found] ` <47DAA1A6.6010509-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-14 16:08 ` Pavel Emelyanov
2008-03-14 16:11 ` Nadia Derbey
2008-03-14 16:11 ` Nadia Derbey
[not found] ` <47DAA3AA.4050906-6ktuUTfB/bM@public.gmane.org>
2008-03-14 16:45 ` Oren Laadan
[not found] ` <47DAABAB.7000706-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-16 3:43 ` Serge E. Hallyn
[not found] ` <20080316034320.GA19793-6s5zFf/epYLPQpwDFJZrxFMas7LaWZ9n@public.gmane.org>
2008-03-16 19:08 ` Oren Laadan
[not found] ` <47DD703C.4030809-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2008-03-17 14:44 ` Serge E. Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4804F971.3020207@cs.columbia.edu \
--to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
--cc=Nadia.Derbey-6ktuUTfB/bM@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nick-dnCCA748QAperShJXdIFYw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox