Date: Sat, 21 Jun 2003 13:50:14 +0400 (MSD) From: Igor Sysoev <is@rambler-co.ru> To: Julian Elischer <julian@elischer.org> Cc: threads@freebsd.org Subject: Re: Implementing TLS: step 1 Message-ID: <Pine.BSF.4.21.0306211316500.29257-100000@is> In-Reply-To: <Pine.BSF.4.21.0306201141480.57806-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 20 Jun 2003, Julian Elischer wrote: > > We can implement such scheme on x86: > > > > gs -> [ TP ] ---> [ TLS ] > > [ struct kse_mailbox ] +-> [ struct kse_thr_mailbox ] > > [ .km_curthread ] -+ > > > > When UTS would switch to the next thread it should set thread's TLS: > > > > kse_mailbox.km_curthread = NULL; > > gs:[0] = next_thr_tls; > > kse_mailbox.km_curthread = next_kse_thr_mailbox; > > yes and the last line is atomic.. But remember having a NULL curhtread > pointer stops upcalls but it is not the ONLY thing that stops upcalls.. > A flag TMF_NOUPCALLS (spelling?) in the mailbox will also inhibit any > upcalls. 1:1 threads (BOUND) threads, (system scope threads?) set this > bit, but they still can have a mailbox for other purposes. (e.g. setting > mode flags and stuff). So NULL curthread is the short term (in UTS only) and atomic method to disable upcalls while KMF_NOUPCALL flag is the long term and non-atomic (we can not atomically update bit masks in general) method ? Igor Sysoev http://sysoev.ru/en/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0306211316500.29257-100000>