Re: Unchecked_Conversion and task pointer.



"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:tb8600lfqd2z.1l9etgzsgcls2.dlg@xxxxxxxxxxxxx
....
> > You can declare a task interface in Ada 200Y:
> >
> > type T_Int is task interface;
> >
> > I probably should have done that in my example.
>
> Can a task interface have entries?

No, there are no stand-alone entries. But a procedure can match an entry and
be called as an entry.

> > You are allowed to use the primitive procedures of an interface in a
timed
> > entry call, and they will work as an entry in that case.
>
> Does it mean that in Ada 200Y any procedure of an interface can be used as
> if it were an entry?

Any primitive procedure of an interface, yes. If it is not an entry, it is
treated as if it is immediately open.

....
> > I wasn't (and am still not) convinced that this is the right design, but
it
> > certainly works and has the needed effects. I think there will be some
> > confusion from a readability standpoint, but otherwise you can do
everything
> > with such a procedure that you can do with an entry (other than requeue
it;
> > no one can figure out how a dispatching requeue could work - it couldn't
> > have been allowed if dispatching entries existed, either).
>
> Why? Ignoring misleading prefix notation can be ignored, to have a
> dispatching requeue, the target task or protected object of the entry must
> be class-wide:

Well, you can't ignore the prefix (it determines whether it is an internal
or external requeue). And I believe that there was another problem as well.
(I don't remember what it was, sorry.) It certainly doesn't work with the
"use a procedure like an entry" model, because it would make no sense to
requeue on a procedure.

Randy.



.



Relevant Pages

  • Re: Unchecked_Conversion and task pointer.
    ... you should definitely use an interface. ... > entry call, and they will work as an entry in that case. ... > with such a procedure that you can do with an entry (other than requeue it; ... similarly to class-wide subroutines there could be class-wide entries. ...
    (comp.lang.ada)
  • [PATCH] Add a non-blocking I2C interface
    ... Here's the code that I have so far for adding a non-blocking interface ... But this mostly is using the queue entry for data, ... of the IPMI SMB driver. ...
    (Linux-Kernel)
  • VB6 Application Overwhelmed by Rapid User Interaction
    ... I have a VB6 app with a somewhat complication user interface screen. ... consists of a grid through which the user can navigate from entry to entry. ...
    (microsoft.public.vb.winapi)
  • Getting prefix length for IPv6 interface address?
    ... What is the correct way to get the prefix length for an IPv6 interface? ... in FirstUnicastAddresses would map to the 2nd entry in FirstPrefix). ... calling GetAdaptersAddresses, it seems to work, but that's a little hack-ish. ... to workaround the FirstUnicastAddress and FirstPrefix lists being ...
    (microsoft.public.win32.programmer.networks)
  • Re: Pragma Unreferenced in GNAT GPL 2008
    ... entry Wait when True is ... requeue Wait_Off with abort; ... entry Wait when S = Reset xor Value = On is ...
    (comp.lang.ada)