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-Thread: 103376,c3c4ae45442f569e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 29 Apr 2005 02:25:48 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: [newbie question] tasks and protected types References: <1114747457.868019.93210@f14g2000cwb.googlegroups.com> X-Newsreader: Tom's custom newsreader Message-ID: <5budnQWp7sjhfOzfRVn-iA@comcast.com> Date: Fri, 29 Apr 2005 02:25:48 -0500 NNTP-Posting-Host: 24.6.127.15 X-Trace: sv3-YjFPyhby57yOM8sob2jrO8yfFhz7dHokFgIMF65dmkPidmTdU+qtf6Vpc3jPSqV6sl6q9re+yOFK+kT!O9PIdBKKNlpqiYJtUOgqLl9tJ9I9CCyyIADdMzoeWdQxgrv/7Ps04uliM58= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:10802 Date: 2005-04-29T02:25:48-05:00 List-Id: 1) Msg is a zero length string. But you try to store Str in it, which will only work if Str is also a null string. This is one of those few places in Ada where you really are forced to use an access type and a "new" (unless somebody has a better idea). 2) G is a single object accessed simultaneously by two tasks. Who knows what unpleasantness may result. 3) Your output file is also a single object accessed simultaneously by two tasks. You may be lucky and have that work for a while, or you may not be lucky. When compiled and run with Janus Ada I get: ** Unhandled CONSTRAINT_ERROR Array length check failed On Line Number 34 In MANAGE.DOOR.START Called from line number 29 In MANAGE.DOOR ## Reraised On Line Number 51 In MANAGE **** DEADLOCK DETECTED; program halted ****