home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / ada / 3285 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.7 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!olivea!charnel!rat!koko.csustan.edu!ceti.csustan.edu!pendell
  2. From: pendell@ceti.csustan.edu (Brian Pendell)
  3. Newsgroups: comp.lang.ada
  4. Subject: Dynamic Tasking in ADA.
  5. Summary: Attempting to write a linked list of tasks in ADA.
  6. Message-ID: <1992Nov16.191941.18504@koko.csustan.edu>
  7. Date: 16 Nov 92 19:19:41 GMT
  8. Sender: pendell@ceti.csustan.edu
  9. Followup-To: same
  10. Distribution: na
  11. Organization: CSU Stanislaus
  12. Lines: 29
  13.  
  14. I am attempting to write a number of tasks for an ADA program. However,
  15. the number of necessary tasks is not known at compile time. Thus, I
  16. must use a dynamic data structure to hold the tasks. Since  I do not
  17. believe ADA allows dynamic arrays, I have decided on a doubly-linked list
  18. of tasks as a close approximation. 
  19.  
  20. Now, I must do the following:
  21.     1. declare and elaborate the task type.
  22.     2. Instantiate my generic list package for this task type. 
  23.     3. write the  task body.
  24.  
  25. Previously, I had elaborated the task type, then instantiated the list 
  26. package, then written the task body. The ada compiler I am using did not
  27. understand this, telling me that my package instantiation occurred too late
  28. in the source code. 
  29.  
  30. My next solution was to declare the task type, then instantiate the package
  31. for the type, then elaborate the task type and the task body. The result
  32. is that I cannot pass an "accept" to my tasks .. the compiler tells me
  33. that this is an illegal operation on an incomplete type. 
  34.  
  35. I'm stuck. How am I going to 
  36. A. build a task and 
  37. B. Instantiate my linked list package so I can have a linked list of tasks?
  38.  
  39. Any help would be GREATLY appreciated. 
  40.  
  41. Thanks, 
  42.     -- Brian Pendell (pendell@ceti.csustan.edu)
  43.