From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60b7644a2b4915a1,start X-Google-Attributes: gid103376,public From: merdi92@tor.hv.se (Morgan Ericsson) Subject: Q: Dynamic tasks spawning error? Date: 1996/04/30 Message-ID: <4m4v27$8a5@fizban.solace.mh.se>#1/1 X-Deja-AN: 152222942 organization: Solace Computer Society, Sundsvall keywords: Ada, task, dynamic, spawn reply-to: merdi92@tufvan.hv.se newsgroups: comp.lang.ada Date: 1996-04-30T00:00:00+00:00 List-Id: We have a problem with a program that involves dynamic spawing of tasks. We think this code should be legal. GNAT (uses gcc 2.7.2) manages to compile and link but as soon as "we" use a dynamically spawned task nothing happens. No busy waiting, no exceptions, no nothing! (We run gnat on Solaris 2.5 machines) What we want to know is wether this is correct ada or a compiler problem. We know that tasks have been a problem in earlier versions of gnat. --8<-- Task def. type List; type pointer is access List; type List is record next : pointer; prev : pointer; salong : Taskp; number : Integer; end record; first, last : pointer; task type Visning is entry tdbokning( Antalp, Onskadp: in Integer; OK: out Boolean; Platsarray: out String); entry tbokning( telnr: in String; Antalp, Onskadp: in Integer; OK: out Boolean; Platsarray: out String); entry tavboka( telnr: in String; Antalp, Onskadp: in Integer; OK: out Boolean; Platsarray: out String); entry thamta( telnr: in String; Antalp, Onskadp: in Integer; OK: out Boolean; Platsarray: out String); end Visning; type Taskp is access Visning; tmpnode := new List; if( first = NULL ) then tmpnode.number := 1; tmpnode.salong := new Visning; -- Is this correct? tmpnode.next := NULL; tmpnode.prev := NULL; first := tmpnode; last := tmpnode; else tmpnode.number := last.number+1; tmpnode.salong := new Visning; -- Is this correct? tmpnode.next := NULL; tmpnode.prev := last; last.next := tmpnode; last := tmpnode; end if; --8<-- Main program p : pointer; -- p points to a list of tasks p.salong.tbokning(telnr, Antalp, Onskadp, OK, Platsarray); -- This is where it stops... --8<-- -- Morgan Ericsson, CS student at Vaxjo Uni (merdi92@tufvan.hv.se) ---------------------------------------------------------------------------- I'm not a psycho! I'm Batman! ---------------------------------------------------------------------------- Check out my WWW page! http://tufvan.hv.se/~merdi92!