Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!feeds.news.ox.ac.uk!news.ox.ac.uk!zen.net.uk!hamilton.zen.co.uk!prichard.zen.co.uk.POSTED!not-for-mail Newsgroups: comp.programming.threads From: Geoff Clare Subject: Re: pthread question References: <39abb345-ad69-453d-89da-29ee8e6e94f2@z15g2000prn.googlegroups.com> <4DC95F77.DAF3CBB4@web.de> User-Agent: XPN/1.2.6 (Street Spirit ; Linux) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Wed, 11 May 2011 13:46:26 +0100 Message-ID: <22dq98-9jj.ln1@leafnode-msgid.gclare.org.uk> Lines: 39 Organization: Zen Internet NNTP-Posting-Host: 281de4e9.news.zen.co.uk X-Trace: DXC=?[`cb6<:JLAe@hNFIWl:K@0g@SS;SF6nGRiiCXJE[K>GAI65E:\_3NHJmKn^0gjVoAa>`3L[7O4eC X-Complaints-To: abuse@zen.co.uk Xref: x330-a1.tempe.blueboxinc.net comp.programming.threads:138 Alexander Terekhov wrote: > > Geoff Clare wrote: > [...] >> 9. When a running thread issues the sched_yield() function, the >> thread becomes the tail of the thread list for its priority. > > That makes sense for a uniprocessor. > > But nowadays even pocket gadgets are multiprocessors. > >> POSIX doesn't standardise internals, but it does standardise how >> threads with the above mentioned scheduling policies are scheduled. > > http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html > > "For application threads with scheduling allocation domains of size > greater than one, the rules defined for SCHED_FIFO, SCHED_RR, [TSP] and > SCHED_SPORADIC shall be used in an implementation-defined manner." Good point. However, earlier in that section the standard says: "It should be noted that the presence of multiple processors does not automatically indicate a scheduling allocation domain size greater than one. Conforming implementations on multi-processors may map all or any subset of the CPUs to one or multiple scheduling allocation domains" > Translation: no rules whatsoever. The way the domain-size-one rules are applied to larger domains is "implementation-defined", which means implementations are required to document how they are applied. Not quite the same as "no rules whatsoever". -- Geoff Clare