comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Gnat Scheduling Question
Date: Sun, 07 Jan 2007 09:20:54 -0500
Date: 2007-01-07T09:20:54-05:00	[thread overview]
Message-ID: <u7ivygbp5.fsf@stephe-leake.org> (raw)
In-Reply-To: mailman.12.1168113384.18371.comp.lang.ada@ada-france.org

"  jpluto" <jpluto@hotmail.com> writes:

> 1. The operating system (OS) schedules tasks, but gnat allow us to
> set schedule policies such as Round Robin and others, then how does
> gnat tell the OS to start doing Round Robin scheduling? or are the
> tasks in gnat are application threads and has nothing to do with the
> OS scheduling. If so, could you describe exactly how are these
> threads built in gnat?

This is very OS specific, and normally is of no concern to Ada
programmers; you should just assume the implementation follows the LRM.

> 2. If someone wants to write a new scheduling policy, which files I
> need to add to and update tell gnat to use my NEW scheduling policy.

That I don't know.

> For example, if I want a high priority task to block, even though it
> does NOT use a shared data object, 

The question is: what Ada construct can you use to make the high
priority task block?

> but if another lower priority task on the "same" cpu 

Why is "same" in quotes?

> is running and is using a shared data object that another task on
> another CPU needs, then how can I block that high priority task and
> tell it to yield the cpu to that lower task unitl that lower task
> finish using that shared data object?

Some implementations of GNAT will distribute threads across
processors. For those implementations, you can use the Ada standard
tasking constructs.

In this case, you need to study the ceiling priority protocol, and
consider how it will work in a multi-cpu setting. I think it should
handle your problem, but i have not studied this in detail.

> 3.  Which gnat files for tasking and scheduling tell the tasks to use these
> files and how these files hookup to the tasking model?
>
> For example, I see for Round Robin, gnat has the following files:
> a-diroro.ads and a-diroro.adb
>
>
> 4. Which gnat file is the file that looks at our program code to know
> exactly which scheduling policy we need using our pragma.  Then once
> it sees which scheduling policy we need, which files and procedures it
> excuetes to run that scheduling policy?

You'll have to ask AdaCore that. 

-- 
-- Stephe



  reply	other threads:[~2007-01-07 14:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-06 19:42 Gnat Scheduling Question   jpluto
2007-01-07 14:20 ` Stephen Leake [this message]
2007-01-15 23:49 ` Jeffrey Carter
replies disabled

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