home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!olivea!charnel!rat!koko.csustan.edu!ceti.csustan.edu!pendell
- From: pendell@ceti.csustan.edu (Brian Pendell)
- Newsgroups: comp.lang.ada
- Subject: Dynamic Tasking in ADA.
- Summary: Attempting to write a linked list of tasks in ADA.
- Message-ID: <1992Nov16.191941.18504@koko.csustan.edu>
- Date: 16 Nov 92 19:19:41 GMT
- Sender: pendell@ceti.csustan.edu
- Followup-To: same
- Distribution: na
- Organization: CSU Stanislaus
- Lines: 29
-
- I am attempting to write a number of tasks for an ADA program. However,
- the number of necessary tasks is not known at compile time. Thus, I
- must use a dynamic data structure to hold the tasks. Since I do not
- believe ADA allows dynamic arrays, I have decided on a doubly-linked list
- of tasks as a close approximation.
-
- Now, I must do the following:
- 1. declare and elaborate the task type.
- 2. Instantiate my generic list package for this task type.
- 3. write the task body.
-
- Previously, I had elaborated the task type, then instantiated the list
- package, then written the task body. The ada compiler I am using did not
- understand this, telling me that my package instantiation occurred too late
- in the source code.
-
- My next solution was to declare the task type, then instantiate the package
- for the type, then elaborate the task type and the task body. The result
- is that I cannot pass an "accept" to my tasks .. the compiler tells me
- that this is an illegal operation on an incomplete type.
-
- I'm stuck. How am I going to
- A. build a task and
- B. Instantiate my linked list package so I can have a linked list of tasks?
-
- Any help would be GREATLY appreciated.
-
- Thanks,
- -- Brian Pendell (pendell@ceti.csustan.edu)
-