comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Protected Objects and Interrupt Handlers
Date: Fri, 26 Feb 2016 08:12:58 +0000
Date: 2016-02-26T08:12:58+00:00	[thread overview]
Message-ID: <ly4mcvopo5.fsf@pushface.org> (raw)
In-Reply-To: uqgvcbp6qi5ge9064l4fu9qsqnkqdf17ec@4ax.com

Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:

> On Thu, 25 Feb 2016 15:59:46 +0000, Simon Wright <simon@pushface.org>
> declaimed the following:
>
>>Maciej Sobczak <see.my.homepage@gmail.com> writes:
>>
>>> Note also that it is easy to combine these two approaches - just let
>>> the interrupt handler (a procedure) interact with a dedicated
>>> protected object (by forwarding to its procedures) as if it was a
>>> regular work-item producing task - which, conceptually, it really is.
>>
>>I think this approach might have problems; if the PO doesn't expect to
>>be called in an interrupt context, it may do things (like block) which
>>an ISR should never do.
>>
> 	As I recall, Ada protected objects are not supposed to contain anything
> that could block.
>
> http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/node25.htm#SECTION00814000000000000000

That's for code _inside_ the PO. As the document you reference says,

   In general, code executed inside a protected object should be as
   brief as possible. This is because whilst the code is being executed
   other tasks are delayed when they try to gain access to the protected
   object.

and you wouldn't want an ISR to be "delayed when [it tries] to gain
access to the protected object".

  reply	other threads:[~2016-02-26  8:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 22:25 Protected Objects and Interrupt Handlers Jere
2016-02-23 23:09 ` Simon Wright
2016-02-24 14:38   ` Jere
2016-02-24 18:29     ` Simon Wright
2016-02-24 21:37       ` Jere
2016-02-25 15:14 ` Maciej Sobczak
2016-02-25 15:59   ` Simon Wright
2016-02-26  3:20     ` Dennis Lee Bieber
2016-02-26  8:12       ` Simon Wright [this message]
2016-02-27 18:06     ` Maciej Sobczak
2016-02-25 16:02   ` Simon Wright
2016-02-25 17:40     ` Tero Koskinen
2016-02-25 19:49       ` Simon Wright
2016-03-13  8:10         ` Simon Wright
replies disabled

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