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-01-31 10:27:57 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out.usenetserver.com!newsfeed.direct.ca!look.ca!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.windows.x.intrinsics,comp.lang.ada,comp.windows.x.motif Subject: Re: Using Xt intrinsics with Ada? Followup-To: comp.lang.ada Date: 31 Jan 2001 13:14:33 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3A78357A.2BD8C0B1@avitech.de> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: skates.gsfc.nasa.gov 980965668 398 128.183.220.71 (31 Jan 2001 18:27:48 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 31 Jan 2001 18:27:48 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 Xref: supernews.google.com comp.windows.x.intrinsics:50 comp.lang.ada:4772 comp.windows.x.motif:883 Date: 2001-01-31T18:27:48+00:00 List-Id: J�rgen Grigat writes: > 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. This seems an awkward approach. You are using a windowing system to get tasking; just use Ada tasking! Allocate one task for each socket connection, that does blocking reads and writes to the socket. Then have a central task that rendezvous with the per-socket tasks. You will need a runtime that blocks at the task level, not the process level. > 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. I'm not sure, but I would bet that XtAppMainLoop is polling, looking for events! So you haven't accomplished anything. > Has anyone experience in using X Toolkit events in Ada tasking > programs? > > Thanks for any hints. > > J�rgen -- -- Stephe