comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent <daemon2@internet.lu>
Subject: Re: Strange behavior
Date: Fri, 5 Sep 2014 13:05:05 -0700 (PDT)
Date: 2014-09-05T13:05:05-07:00	[thread overview]
Message-ID: <efce3f28-1d61-420c-93af-5b09076d5c02@googlegroups.com> (raw)
In-Reply-To: <8c587c07-fde3-45c7-8d8e-c3541ea4e0e4@googlegroups.com>

Am Freitag, 5. September 2014 21:47:19 UTC+2 schrieb sbelm...@gmail.com:
> On Friday, September 5, 2014 3:30:51 PM UTC-4, Laurent wrote:
> 
> > 
> 
> > The order of the tasks executing is random and that is ok but why  is it changing and why is the New_Line zapped?
> 
> > 
> 
> 
> 
> Because the order of the tasks is random; what else would you expect?  The new lines aren't zapped, its just that the OS switches tasks after the Put_Line but before the New_Line.  You get it back the next time, hence the blank space (two CR/LFs in a row).
> 
> 
> 
> -sb

Because the sample run in the book looks a bit different. More like this:

Hello from Task A
Hello from Task B 
Hello from Task A
Hello from Task B 
Hello from Task A 
Hello from Task B 
Hello from Task A 
Hello from Task B 
Hello from Task A
Hello from Task B 

or 

Hello from Task B 
Hello from Task A
Hello from Task B 
Hello from Task A
.
.
.

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? 

Sorry for the noob questions

The more I learn about programming the more I understand that I don't even have scratched the surface.

Thanks

Laurent


  reply	other threads:[~2014-09-05 20:05 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 [this message]
2014-09-06  0:53     ` Dennis Lee Bieber
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