Date: Sat, 27 Nov 1999 23:39:08 -0500 From: "Daniel M. Eischen" <eischen@vigrid.com> To: Julian Elischer <julian@whistle.com> Cc: arch@freebsd.org Subject: Re: Threads stuff Message-ID: <3840B1EC.4614AAF0@vigrid.com> References: <Pine.BSF.4.10.9911271542410.544-100000@current1.whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer wrote:
>
> > I've put a diagram up on my web page that tries to incorporate
> > some of these ideas. I haven't included the queue-ing, because
> > that seems basically agreed upon.
> [...]
> > I'm just going from what Daniel said about libc_r having
> > to get the time of day and set the interval timer in
> > order to do a context switch, which can probably be
> > done in one system call. Either the context can be
> > saved in userland, in which case the scheduler returns
> > normally, and does a longjmp or the equivalent,
> > or the thread could be resumed as part of the
> > system call.
> >
>
> I don't know what Danthiks but this has alot more involvement or the
> kernel and boundary crossing than I was envisionning.
I think it's basically right. If you saw the diagram at different
stages, it would be easier to see.
o A thread blocks in kernel, the KSE is saved, a new KSE is allocated,
and an upcall is made to the scheduler with a unique KSE ID provided
to identify the now blocked thread.
o Scheduler receives notification of a thread blocking, tags the
currently running thread with the KSE ID, chooses a new thread
to run, switches to the new thread, and makes a system call to
schedule a signal/upcall when the new threads quantum expires.
o A KSE is woken up in the kernel.
o Scheduler receives notification of a thread unblocking (finishing?)
in the kernel.
o At the request of the scheduler, the kernel schedules a timeout for
the new quantum and resumes the now unblocked thread.
> I will try make aset of diagrams that outline the state of various
> objects related to a thread at various stages..
How about an animated GIF or MOV? ;-)
Dan Eischen
eischen@vigrid.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3840B1EC.4614AAF0>
