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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 05 Sep 2014 19:53:09 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Strange behavior Date: Fri, 05 Sep 2014 20:53:47 -0400 Organization: IISS Elusive Unicorn Message-ID: References: <6967b17b-acb9-4b44-b21a-6ddcab1e1065@googlegroups.com> <8c587c07-fde3-45c7-8d8e-c3541ea4e0e4@googlegroups.com> X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.118.117 X-Trace: sv3-kbOyeXhWP1DmzbDOX7TwAWFb94b6YZOFug7DNOZkL3Mf+H/mGNHh+OSwQ5OFLZgqjDrNH4oH+xJalHv!hdk5BlYknqe5XqcYXdq003Wb0SfS8BgnPTS9RYulcF98kuoGX4FrFma30z3DrONdQN3TL5ktwjgA!j2nbI9+q0dNEgPBwwI92NVbpuR5Z X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2597 Xref: number.nntp.dca.giganews.com comp.lang.ada:188887 Date: 2014-09-05T20:53:47-04:00 List-Id: On Fri, 5 Sep 2014 13:05:05 -0700 (PDT), Laurent declaimed the following: > >No sudden inversion of the order. >What has the switching of the tasks to do with this? Shouldn't the delay 0,1 prevent that? That's an eternity for a computer. The New_Line is part of the task? Or is the OS trying to do me a favor by distributing the task on different cores which produces garbage? > The delay statement provides the OS a known point at which a task switch CAN (and likely will) take place. However, a task switch can take place on ANY operation that hands off to the OS -- that means any I/O call is a point at which a task switch can occur. More so with a hyperthreaded/multi-core processor, since a task that has just invoked an I/O operation is blocked waiting for that I/O to complete; the other task is free to run at that time (on any core). The delay only ensures you get some sort of alternation. Without a delay, on a single core, and with a fast I/O system, it is possible that one task could run to completion before the other task even started to run. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/