9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] bug in rio: unhiding deleted windows
Date: Sun, 23 Nov 2008 16:51:11 -0500	[thread overview]
Message-ID: <515b2b3a3bd91e7fd9b7e7e78d03deed@quanstro.net> (raw)
In-Reply-To: <a560a5d00811231150i4a37cac6y29e632ec59316080@mail.gmail.com>

> situation, maybe this could be added to /sys/src/cmd/rio/rio.c:
>
> : ruda; diff rio.c rio.c_orig
> 683c683
> < 		if(hidden[i] != nil) unhide(i);
> ---
>> 		unhide(i);
> : ruda;
>
> This usually helps, but it neither solves much, nor it is 100 % sure
> it saves you. The problem, as I see it now, is more difficult.
>
> Rio apparently stores a list of hidden windows in
>     Window *hidden[100]
> Should this list couldn't change when playing with rio's menus, things
> would be easy. But it can (the hidden window in our example exits).
> And, generally, it can possibly change in any way. To underline this
> fact, note that even on one single line like mine
>     if(hidden[i] != nil) unhide(i);

the problem is that the fs proc and the keboard thread both fiddle with
the the hidden array.  in the style of rio, the solution would be
along the lines of sending a message (say) the keyboard thread to hide
the window.  since windows have unique ids, sending a message like
"hide 72" would be unambiguous.

acme has similar problems that tend to show up on laggy connections.

> In this view I feel the whole thing is just flawed. I appologise to
> the authors, if I am wrong.

i didn't write rio.  saying the "whole thing is just flawed" is a bit
over the top.  you've identified a concurrency bug that isn't fatal.
if it bothers you, then please fix it.  we'd be appreciative.

> But it definitely disappointed me, along
> with limitations like that 100 static allocation size (and there are
> more). I'd like to see a system _without_ any such static things in
> spite of the fact you probably will never have so many hidden windows.

why?  i don't think it makes sense to say static sizes are unequivicablly bad.
static allocation has advantages.  it's simplier and less error prone, and
there are no concurrency considerations.  there are always tradeoffs.  and
in this case, i fail to see the advantage of allowing more than 100 hidden
windows so if anything, i would only wonder why the limit was so high.

> I consider it a good & only right way how it should be done today.

i think you need to make a case for this and explain how you would
handle concurrent access to allocated structures.  keep in mind that
realloc can move things around.

- erik




  reply	other threads:[~2008-11-23 21:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08 20:51 andrey mirtchovski
2008-10-10 11:53 ` Rudolf Sykora
2008-10-10 12:32   ` andrey mirtchovski
2008-10-10 12:54     ` erik quanstrom
2008-10-10 20:23       ` Lyndon Nerenberg
2008-10-11  3:05         ` Russ Cox
2008-10-11 11:11           ` Rudolf Sykora
2008-10-10 13:15     ` andrey mirtchovski
2008-10-10 13:21       ` Rudolf Sykora
2008-10-10 13:18         ` erik quanstrom
2008-10-10 14:02           ` Rudolf Sykora
2008-10-10 14:41             ` erik quanstrom
2008-10-10 15:25               ` Rudolf Sykora
2008-10-10 15:21                 ` erik quanstrom
2008-10-10 15:42                   ` Rudolf Sykora
2008-10-10 15:33                 ` ron minnich
2008-10-10 15:41                   ` Rudolf Sykora
2008-10-10 16:20                     ` andrey mirtchovski
2008-10-10 16:26                       ` Rudolf Sykora
2008-10-10 16:30                         ` andrey mirtchovski
2008-10-10 16:43                           ` Rudolf Sykora
2008-10-10 15:45                   ` andrey mirtchovski
2008-10-10 16:36               ` matt
2008-10-10 16:40                 ` Rudolf Sykora
2008-10-11 12:44                 ` erik quanstrom
2008-11-23 19:50 ` Rudolf Sykora
2008-11-23 21:51   ` erik quanstrom [this message]
2008-11-26 19:52     ` Rudolf Sykora
2008-11-26 20:55       ` erik quanstrom

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=515b2b3a3bd91e7fd9b7e7e78d03deed@quanstro.net \
    --to=quanstro@quanstro.net \
    --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).