9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] what am i missing
@ 2012-04-25 19:46 erik quanstrom
  2012-04-25 20:03 ` Russ Cox
       [not found] ` <CADSkJJV_C6qrqDDXgRm0jPwRWoX2-YckOCf1bMati625Co5CMg@mail.gmail.c>
  0 siblings, 2 replies; 7+ messages in thread
From: erik quanstrom @ 2012-04-25 19:46 UTC (permalink / raw)
  To: 9fans

i just modified _schedexecwait to not eat wait messages.

i think that if you're asynchronously procexecing() and
waiting for wait messages, some could have been lost.

have i missed something?  this seems too basic.

- erik
---

void
_schedexecwait(void)
{
	int pid;
	Channel *c;
	Proc *p;
	Thread *t;
	Waitmsg *w;

	p = _threadgetproc();
	t = p->thread;
	pid = t->ret;
	_threaddebug(DBGEXEC, "_schedexecwait %d", t->ret);

	rfork(RFCFDG);
	for(;;){
		w = wait();
		if(w == nil)
			break;
		if(w->pid == pid)
			break;
++		if((c = _threadwaitchan) != nil)
++			sendp(c, w);
++		else
			free(w);
	}
	if(w != nil){
		if((c = _threadwaitchan) != nil)
			sendp(c, w);
		else
			free(w);
	}
	threadexits("procexec");
}



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-25 21:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-25 19:46 [9fans] what am i missing erik quanstrom
2012-04-25 20:03 ` Russ Cox
     [not found] ` <CADSkJJV_C6qrqDDXgRm0jPwRWoX2-YckOCf1bMati625Co5CMg@mail.gmail.c>
2012-04-25 20:06   ` erik quanstrom
2012-04-25 20:14     ` Russ Cox
     [not found]     ` <CADSkJJVeG7ZqCpnqVd0SvRhKmnWUrewX04kYVX-VTUb50Uemqw@mail.gmail.c>
2012-04-25 20:37       ` erik quanstrom
2012-04-25 21:00         ` Russ Cox
     [not found]         ` <CADSkJJURoTSsuNHWpHb6=yWvQh9-DpQ3h+nMxC=s0AdYUj-h_A@mail.gmail.c>
2012-04-25 21:10           ` erik quanstrom

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).