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 X-Google-Thread: 11038b,9f5633938c224117 X-Google-Attributes: gid11038b,public X-Google-Thread: 103376,9f5633938c224117 X-Google-Attributes: gid103376,public X-Google-Thread: 10b6ac,9f5633938c224117 X-Google-Attributes: gid10b6ac,public X-Google-ArrivalTime: 2001-02-01 04:05:56 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeed.online.be!tank.news.pipex.net!pipex!warm.news.pipex.net!pipex!news.kvaerner.com!news@kvaerner.com From: "Tarjei T. Jensen" Newsgroups: comp.windows.x.intrinsics,comp.lang.ada,comp.windows.x.motif Subject: Re: Using Xt intrinsics with Ada? Date: Thu, 1 Feb 2001 12:55:24 +0100 Organization: Kvaerner Group IT Message-ID: <95birb$7o2@news.kvaerner.com> References: <3A78357A.2BD8C0B1@avitech.de> NNTP-Posting-Host: 155.209.159.50 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Newsreader: Microsoft Outlook Express 4.72.2120.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Xref: supernews.google.com comp.windows.x.intrinsics:55 comp.lang.ada:4813 comp.windows.x.motif:889 Date: 2001-02-01T12:55:24+01:00 List-Id: J�rgen Grigat wrote in message <3A78357A.2BD8C0B1@avitech.de>... >Hi, > >we are developing a program in Ada that has connections to other processes by >sockets. The calls are done in Ada by using interfaces to C library functions. >In order to avoid polling we wonder if we can use the event mechanism of X >Toolkit Intrinsics. So we created a task which is calling a C-routine that >itself calls XtAppMainLoop. The main program is an Ada routine. >>From the functional point of view this seems to work. But we recognize a heavy >CPU load even there is no traffic at the connection. > >Has anyone experience in using X Toolkit events in Ada tasking programs? As someone else said: This is a job for select() and friends. See W. Richard Stevens "Unix network programming" 2nd edition for how to do this and what options are available. You should have no problem doing this in Ada. BTW. are you sure that this cannot be done by using the distributed annex in Ada? Gnat is supposed to have all the distributed annex stuff implemented. Greetings,