Date: Sun, 22 Jun 2003 23:16:38 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: Igor Sysoev <is@rambler-co.ru> Cc: threads@freebsd.org Subject: Re: Implementing TLS: step 1 Message-ID: <Pine.BSF.4.21.0306222315590.79545-100000@InterJet.elischer.org> In-Reply-To: <Pine.BSF.4.21.0306211316500.29257-100000@is>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 21 Jun 2003, Igor Sysoev wrote: > 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 ? exactly. > > > 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.0306222315590.79545-100000>