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,8af9e3a438ec928a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit From: "P Hull" Newsgroups: comp.lang.ada References: <41400af9$1@dnews.tpgi.com.au> Subject: Re: process blocking Date: Thu, 9 Sep 2004 21:50:28 +1000 Organization: - X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 220.244.246.241 X-Original-NNTP-Posting-Host: 220.244.246.241 Message-ID: <41404385$1@dnews.tpgi.com.au> X-Trace: dnews.tpgi.com.au!tpg.com.au 1094730629 220.244.246.241 (9 Sep 2004 21:50:29 +1000) Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!not-for-mail Xref: g2news1.google.com comp.lang.ada:3535 Date: 2004-09-09T21:50:28+10:00 List-Id: > > Hi, I know this is possible, but how does one go about having a process (p1) > > siezing control of another process (pMain) such that no other process (p2, > > p3, .. pn) is able to access pMain? I am guessing you define one channel and > > maintain access to this channel? I have no idea how to implement such > > blocking. > > If you can use an Ada task for your "process", and by "access" you > mean "rendezvous with", then this is a matter of visibility; make sure > task pMain is only visible to task p1. Declaring pMain in a private > child of the package that declares p1 is one way to do this. > > However, that is a static solution. If you need to change which tasks > are able to rendezvous with pMain at run time, you'll need a different > mechanism. > > If you explain more about why you think you need to do this, there is > probably another way to accomplish it. Hi thanks for the reply. Oh i was not looking for a static solution. pMain is visible to all tasks p1..pn. The first task (i.e. one of p1..pn based upon some timing mechanism) will rendezvous with pMain and seizes pMain. And once pi has finished whatever it wants to do with pMain, some other task within p1..pn will then next rendezvous with pMain and seize it, and once finished .. etc etc I know this should be simple to implement. Thanks for any help Peter