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,5d05ccde5cefb836 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Tasks and C/C++ code. Date: 1998/11/19 Message-ID: <3654746F.3C297E56@elca-matrix.ch>#1/1 X-Deja-AN: 413606949 Content-Transfer-Encoding: 7bit References: <364702E5.F6987321@hiwaay.net> <729ndu$jfo$1@nnrp1.dejanews.com> <72b35b$pll$1@nnrp1.dejanews.com> <87btm52jwl.fsf@zaphod.enst.fr> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-11-19T00:00:00+00:00 List-Id: Samuel Tardieu wrote: > > >>>>> "David" == dbotton writes: > > David> I think it would be practical to create a protected type that > David> wrapped your C function to insure that it is not be run > David> concurrently (if it isn't safe). If it's safe then just call it > David> as you would any other Ada Procedure/Function. > > You can't do that for abitraries C functions: it must not contain any > potentially blocking code. Why not ? If the C function is potentially blocking _and_ non-reentrant (as is gethostbyname for example, which can take some time), then it's the only option.