comp.lang.ada
 help / color / mirror / Atom feed
* Gnat Scheduling Question
@ 2007-01-06 19:42   jpluto
  2007-01-07 14:20 ` Stephen Leake
  2007-01-15 23:49 ` Jeffrey Carter
  0 siblings, 2 replies; 3+ messages in thread
From:   jpluto @ 2007-01-06 19:42 UTC (permalink / raw)
  To: comp.lang.ada


Please does anyone know the answer to the following questions?

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?

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.


For example, if I want a high priority task to block, even though it does 
NOT use a shared data object, but  if another lower priority task on the 
"same" cpu 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?


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?

thank you

_________________________________________________________________
Dave vs. Carl: The Insignificant Championship Series. �Who will win? 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://davevscarl.spaces.live.com/?icid=T001MSN38C07001




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gnat Scheduling Question
  2007-01-06 19:42 Gnat Scheduling Question   jpluto
@ 2007-01-07 14:20 ` Stephen Leake
  2007-01-15 23:49 ` Jeffrey Carter
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2007-01-07 14:20 UTC (permalink / raw)


"  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gnat Scheduling Question
  2007-01-06 19:42 Gnat Scheduling Question   jpluto
  2007-01-07 14:20 ` Stephen Leake
@ 2007-01-15 23:49 ` Jeffrey Carter
  1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Carter @ 2007-01-15 23:49 UTC (permalink / raw)


  jpluto wrote:
> 
> For example, if I want a high priority task to block, even though it 
> does NOT use a shared data object, but  if another lower priority task 
> on the "same" cpu 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?

If they're on the same CPU, then using a ceiling priority higher than 
that of the high-priority task should do it.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-15 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06 19:42 Gnat Scheduling Question   jpluto
2007-01-07 14:20 ` Stephen Leake
2007-01-15 23:49 ` Jeffrey Carter

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