From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71b19e01eae3a390 X-Google-Attributes: gid103376,public From: "Robert I. Eachus" Subject: Re: Context Switching Date: 1999/05/11 Message-ID: <3738A31D.1013C463@mitre.org>#1/1 X-Deja-AN: 476753481 Content-Transfer-Encoding: 7bit References: <3736e104@eeyore.callnetuk.com> <37383ab3@eeyore.callnetuk.com> <7h9nl5$9hr$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: The MITRE Corporation Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-11T00:00:00+00:00 List-Id: Robert Dewar wrote: > You have to be careful here. The raw hardware speed for a > context switch is not what is interesting, what is interesting > is the time for executing the COMPLETE pthread call that causes > the context switch. > > For example, the actual raw hardware speed for changing a task > priority is probably just a single store instruction, but it may > well take hundreds or even thousands of instructions to filter > through the necessary kernel machinery to get to the point of > issuing that store! Actually we have been finding on some modern microprocessors that the (distributed) overhead of cache misses can dominate other costs. On others, where the cache is a "physical" cache that does not have to be invalidated, this overhead is very small. I don't remember which chips are which here, but there were some cases where the cache miss overhead tripled the cost of a thread switch. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...