9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Privalloc(2) and rfork(RFPROC|RFMEM) (was: a pair nec bugs)
Date: Sun,  6 Sep 2015 15:12:19 +0100	[thread overview]
Message-ID: <CAOw7k5h1GVdeK4GntK4xEUqy3-_d8QSbVWE1ZC=jEoNdPq=UTA@mail.gmail.com> (raw)
In-Reply-To: <82a662b665bce9245bfda986a0604ddb@felloff.net>

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

On 6 September 2015 at 00:38, <cinap_lenrek@felloff.net> wrote:

> is privfree() broken? it appears it chains the slots together,
> but only the calling process will get a correct chain.
>

The only way it works is to have a main process allocate and free slots for
use by
all participants, which is a workable scheme in many cases, and indeed
preferable
to a strictly-local allocation for certain types of data. For instance, to
tag a process
with (say) an application-defined Proc structure, that structure must be at
the same slot in
every process to allow it to be found.

With that scheme, there isn't any need for the lock, because only one
process can call it. If the cells were instead allocated using a strictly
local free list or bitmap,
which would be possible, there still wouldn't be any need for the lock,
so the original thinking is still obscure.

i think the logic in tprivalloc is what was intended.
>

probably, since a shared bitmap would need a lock and allow
any process to allocate a slot, which could then either be broadcast
to allow per-process tagging (as above), or allocation of a slot of only
local interest. even so, tprivfree is incomplete.

[-- Attachment #2: Type: text/html, Size: 2706 bytes --]

  parent reply	other threads:[~2015-09-06 14:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 14:03 Giacomo Tesio
2015-09-05 14:11 ` Giacomo Tesio
2015-09-05 15:27 ` erik quanstrom
2015-09-05 16:41   ` erik quanstrom
2015-09-05 18:42     ` Giacomo Tesio
2015-09-05 18:47       ` erik quanstrom
2015-09-05 23:03         ` Giacomo Tesio
2015-09-05 18:56       ` cinap_lenrek
2015-09-05 22:45 ` Charles Forsyth
2015-09-05 23:38   ` cinap_lenrek
2015-09-06 13:14     ` erik quanstrom
2015-09-06 14:12     ` Charles Forsyth [this message]
2015-09-06 15:02       ` erik quanstrom
2015-09-06 20:21         ` Charles Forsyth
2015-09-07  0:30           ` erik quanstrom
2015-09-07  9:38             ` Charles Forsyth
2015-09-07 11:59               ` Charles Forsyth
2015-09-06 18:21       ` cinap_lenrek
2015-09-06 20:27         ` Charles Forsyth

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='CAOw7k5h1GVdeK4GntK4xEUqy3-_d8QSbVWE1ZC=jEoNdPq=UTA@mail.gmail.com' \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).