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] devproc noteid changing for none
Date: Thu,  2 Jan 2014 17:57:54 -0500	[thread overview]
Message-ID: <a479f284726ba7c37747d63551fc4c4d@mikro> (raw)
In-Reply-To: <88f3a9a7b4b349bbc153cae9e1f0dfde@felloff.net>

On Thu Jan  2 17:54:50 EST 2014, cinap_lenrek@felloff.net wrote:
> no. the debug qlock is so the process wont exit. once you hold it,
> the process might be running, might be in the process of exiting
> might have been already exited or might have been reused.
>
> the key here is that while you hold it. it wont make it to the
> process freelist when not already there. it wont change
> from "exiting -> exited". but it wont prevent it from being
> reused when it was exited already... but...
>
> pexit() zeros p->alarm. and p->alarm can not be set to non-zero
> value again while we hold the alarms qlock in the kproc!
>
> so this actually works.
>

the code says you can set alarm = 0 without holding the alarms lock.

ulong
procalarm(ulong time)
{
	Proc **l, *f;
	ulong when, old;

	if(up->alarm)
		old = tk2ms(up->alarm - sys->ticks);
	else
		old = 0;
	if(time == 0) {
>>		up->alarm = 0;
>>		return old;

- erik



  reply	other threads:[~2014-01-02 22:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02 21:17 cinap_lenrek
2014-01-02 21:22 ` erik quanstrom
2014-01-02 21:29   ` cinap_lenrek
2014-01-02 21:32   ` cinap_lenrek
2014-01-02 21:35     ` erik quanstrom
2014-01-02 21:41       ` cinap_lenrek
2014-01-02 21:43       ` erik quanstrom
2014-01-02 21:55         ` cinap_lenrek
2014-01-02 22:31           ` erik quanstrom
2014-01-02 22:47             ` erik quanstrom
2014-01-02 22:56               ` cinap_lenrek
2014-01-02 22:53             ` cinap_lenrek
2014-01-02 22:57               ` erik quanstrom [this message]
2014-01-02 23:01                 ` cinap_lenrek
2014-01-02 23:04                   ` erik quanstrom
2014-01-02 23:05                 ` cinap_lenrek
2014-01-02 23:09                 ` cinap_lenrek
2014-01-02 23:17                   ` cinap_lenrek
2014-01-02 23:28                     ` erik quanstrom
2014-01-03  0:23                       ` erik quanstrom
2014-01-03  0:32                         ` cinap_lenrek
2014-01-03  1:16                           ` erik quanstrom
2014-01-03  1:23                             ` cinap_lenrek
2014-01-03  1:31                               ` 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=a479f284726ba7c37747d63551fc4c4d@mikro \
    --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).