comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: GNAT Task Scheduling in Linux
Date: Thu, 28 Jun 2001 14:53:00 GMT
Date: 2001-06-28T14:53:00+00:00	[thread overview]
Message-ID: <gxH_6.455$Kf3.4029@www.newsranger.com> (raw)
In-Reply-To: 7sbsn966zs.fsf@salmon.ls.fi.upm.es

In article <7sbsn966zs.fsf@salmon.ls.fi.upm.es>, Manuel Carro says...
>    Hello.  I have a question regarding the (default) task scheduling
>policy of GNAT (3.13p) in Linux.  I have a simple program which starts
>some tasks which increment a nonprotected variable.  The tasks should
>start (almost) at once, so that the variable is incremented
>concurrently (and wrongly), and the problem is that every task is
>started only after another task has finished.  Hence, the problem of
>concurrent access does not show up.

I belive the FSU threads were designed to allow validation of the Ada compiler.
As such, they follow the priority scheduling clause of the real-time annex (LRM
D.2) to the letter. In particular, it implements the FIFO_Within_Priorities task
dispatching policy, and follows the rules set out in D.2.1 for switching at
"task dispatching points". The language only defines such points to be "delay"
statements, rendezvous, and the changing of the running task's priority, if I
read it right. If they only implemented the minimum required to conform with the
LRM, then you can't exepect to see task switches at any other time.

You might try making one of the tasks higher priority, and having it put itself
to sleep with "delay" statements before a variable update. That way its possible
that the delay might expire, forcing the start of the higher-priority task,
during an update to the variable in the lower-priority task. It'd be hit-or-miss
causing an actual invalid update this way, but these are always hit-or-miss
types of errors.


---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



      reply	other threads:[~2001-06-28 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-27 19:46 GNAT Task Scheduling in Linux Manuel Carro
2001-06-28 14:53 ` Ted Dennison [this message]
replies disabled

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