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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9abd81bc653d971b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-23 08:06:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3A967C6D.5D2A8B83@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: JGNAT and Tasking problem References: <3A925758.3D120457@earthlink.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 23 Feb 2001 16:05:15 GMT NNTP-Posting-Host: 158.252.123.95 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 982944315 158.252.123.95 (Fri, 23 Feb 2001 08:05:15 PST) NNTP-Posting-Date: Fri, 23 Feb 2001 08:05:15 PST Xref: supernews.google.com comp.lang.ada:5479 Date: 2001-02-23T16:05:15+00:00 List-Id: "Marc A. Criley" wrote: > > I've been working with JGNAT 1.1p lately on RedHat Linux 6.2 and having > pretty good success. > > However I'm now experiencing a problem with code that does tasking (up > till now I've been working on single-threaded code, but now it's time to > start getting concurrent). > > Here's a simple example: > > -------------------------------- > with Text_IO; use Text_IO; > > procedure Simple_Task is > > task Simple is > entry Start; > end Simple; > > task body Simple is > begin > select > accept Start; > or > terminate; > end select; > end Simple; > > begin > Put_Line("Start..."); > Simple.Start; > Put_Line("Stop"); > end Simple_Task; > -------------------------------- > > With GNAT 3.13p this compiles and runs just fine. > > With JGNAT 1.1p it compiles, but when I try to run it I get the > following JVM error: > > Marc say: java simple_task > Exception in thread "main" java.lang.IllegalMonitorStateException > at > jgnat.adalib.system$task_primitives$operations.write_lock__2(s-taprop.adb:229) > at > jgnat.adalib.system$task_primitives$operations.lock_all_tasks_list(s-taprop.adb:771) > at > jgnat.adalib.system$task_primitives$operations.enter_task(s-taprop.adb:373) > at > jgnat.adalib.system$task_primitives$operations.initialize(s-taprop.adb:834) > at jgnat.adalib.system$tasking._elabb(s-taskin.adb:186) > at ada_simple_task.adainit(b~simple_task.adb:84) > at simple_task.main(simple_task.adb) > > I'm using the Blackdown distribution of Java for Linux; it's version > information is: > > Marc say: java -version > java version "1.3.0" > Java(TM) 2 Runtime Environment, Standard Edition (build > Blackdown-1.3.0-FCS) > Java HotSpot(TM) Client VM (build Blackdown-1.3.0-FCS, mixed mode) > > I've looked over the JGNAT documentation and tasking is mentioned within > it, so I wouldn't have expected any intrinsic problems using it. Nor > did I notice any sort of "init" preparation that had to be done before > tasking could be used. > > Any suggestions or advice would be appreciated! > > Marc Following up on my own message (for posterity's sake :-)... The problem with tasking arose because I'd moved from JDK 1.2.2 to JDK 1.3, and the JGNAT 1.1p run-time library apparently has fits with that. When I reset the paths to use the 1.2.2 directory which I still had installed, everything's worked fine since then. (I'd hand-modified the PATH in an xterm to test that, but apparently I messed something up and was getting the same problem.) So, JGNAT 1.1p seems to be fine with non-tasking Ada software under JDK 1.2.2 or JDK 1.3, but tasking works only with JDK 1.2.2. Movin' on... Marc