comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Strange behavior
Date: Fri, 05 Sep 2014 20:53:47 -0400
Date: 2014-09-05T20:53:47-04:00	[thread overview]
Message-ID: <pcmk0al1qsiecjsodb39ubr676dokrlov1@4ax.com> (raw)
In-Reply-To: efce3f28-1d61-420c-93af-5b09076d5c02@googlegroups.com

On Fri, 5 Sep 2014 13:05:05 -0700 (PDT), Laurent <daemon2@internet.lu>
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/


  reply	other threads:[~2014-09-06  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 19:30 Strange behavior Laurent
2014-09-05 19:47 ` sbelmont700
2014-09-05 20:05   ` Laurent
2014-09-06  0:53     ` Dennis Lee Bieber [this message]
2014-09-06  1:35       ` Adam Beneschan
2014-09-05 20:23 ` Jeffrey Carter
2014-09-05 20:48   ` Robert A Duff
2014-09-05 20:34 ` Robert A Duff
2014-09-05 20:40   ` Laurent
2014-09-06  1:10     ` Dennis Lee Bieber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox