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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a2093760395cf2a X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Purposes of Ada.Task_Identification Date: 1999/06/24 Message-ID: #1/1 X-Deja-AN: 493532590 References: <7ktva7$edh$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 930260562 206.170.2.53 (Thu, 24 Jun 1999 14:42:42 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Thu, 24 Jun 1999 14:42:42 PDT Newsgroups: comp.lang.ada Date: 1999-06-24T00:00:00+00:00 List-Id: > I occasionally wonder what the intended purpose of the package >Ada.Task_Identification is. It's sometimes handy for a resource locking routine to know if the currect request in fact comes from the current owner of the resource. A comparison of the Id of the owner to that of the requestor will answer that question. Some compilers will return True for Is_Callable(the environment task) while the main program is running, and False after it has terminated (and is waiting for child tasks to terminate). I understand there's an AI in the works to make this standard practice. Where it works, it allows a long-running task to detect that the program is trying to stop, and to stop itself. This handles situations where a "select ... or terminate", or an abort, are inappropriate. Sometimes in debugging a multi-tasking system it's nice to be able to log some activity and include in the log which task performed that activity. That's just how I use Ada.Task_Identification.