Re: Unchecked_Conversion and task pointer.
- From: "Randy Brukardt" <randy@xxxxxxxxxxxxxx>
- Date: Sat, 9 Jul 2005 20:42:33 -0500
"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:28m5yx3jhzvu$.16u6va8093srl.dlg@xxxxxxxxxxxxx
....
> > No, you should definitely use an interface.
>
> It depends. Tasks are still non-tagged in the sense that you cannot have a
> "task" interface.
You can declare a task interface in Ada 200Y:
type T_Int is task interface;
I probably should have done that in my example.
> In an interface Who_Am_I can only be a *procedure*, which
> could be then implemented by an entry. But it should an *entry* from the
> beginning if the intent is to have a dispatching entry Who_Am_I called
> using, say, timed entry call.
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. So while the
*syntax* is that of a procedure, they do not lose their entry
characteristics and still act as an entry.
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).
> In that case mix-in will be the only workaround.
Not at all. See above.
Randy.
.
- Follow-Ups:
- Re: Unchecked_Conversion and task pointer.
- From: Dmitry A. Kazakov
- Re: Unchecked_Conversion and task pointer.
- References:
- Unchecked_Conversion and task pointer.
- From: e.coli
- Re: Unchecked_Conversion and task pointer.
- From: Dmitry A. Kazakov
- Re: Unchecked_Conversion and task pointer.
- From: Randy Brukardt
- Re: Unchecked_Conversion and task pointer.
- From: Dmitry A. Kazakov
- Unchecked_Conversion and task pointer.
- Prev by Date: Re: STORAGE_ERROR : EXCEPTION_STACK_OVERFLOW
- Next by Date: Re: GCC 4.0 Ada.Containers Cursor danger.
- Previous by thread: Re: Unchecked_Conversion and task pointer.
- Next by thread: Re: Unchecked_Conversion and task pointer.
- Index(es):
Relevant Pages
|