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: 10b6ac,9f5633938c224117 X-Google-Attributes: gid10b6ac,public X-Google-Thread: 11038b,9f5633938c224117 X-Google-Attributes: gid11038b,public X-Google-Thread: 103376,9f5633938c224117 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-02 08:43:05 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!134.222.94.5!npeer.kpnqwest.net!EU.net!blackbush.xlink.net!kilbeggan.xlink.net!not-for-mail From: Juergen Fischer Newsgroups: comp.windows.x.intrinsics,comp.lang.ada,comp.windows.x.motif Subject: Re: Using Xt intrinsics with Ada? Date: Fri, 02 Feb 2001 17:40:45 +0100 Organization: Avitech - Aviation Management Technologies GmbH Message-ID: <3A7AE30C.4B0EC8FD@avitech.de> References: <3A78357A.2BD8C0B1@avitech.de> <3A7ADB63.55BAA625@amsjv.com> NNTP-Posting-Host: fw1.avitech.de Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F1026C1246C8C20CAADC43DA" X-Trace: kilbeggan.xlink.net 981132043 18175 194.121.221.60 (2 Feb 2001 16:40:43 GMT) X-Complaints-To: news-support@xlink.net NNTP-Posting-Date: 2 Feb 2001 16:40:43 GMT To: Des Walker X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en Xref: supernews.google.com comp.windows.x.intrinsics:58 comp.lang.ada:4866 comp.windows.x.motif:900 Date: 2001-02-02T16:40:43+00:00 List-Id: This is a multi-part message in MIME format. --------------F1026C1246C8C20CAADC43DA Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi Des, Des Walker wrote: > J�rgen Grigat wrote: > > > > 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? > > > > Thanks for any hints. > > > > J�rgen > > Hi J�rgen, > > Just to throw a bit more into the melting pot. We have some > applications using Xt and Ada and don't seem to have had the problem you > describe. It may depend what level of load you mean by a heavy CPU load. Although the process is in a wait state the CPU load was about 50%. > > > The first issue of our application was built using a Verdix Ada83 > compiler and ran on a SPARC5 processor. Multithreading X wasn't > available so we used XtAppAddInput to allow external messages to be > processed in the context of the Main Loop (some messages required an > update to the displayed picture). In the end we settled for separate Ada > tasks to handle the Inet sockets, which queued all their messages on a > single Unix domain socket. It was only the Unix domain socket which was > monitored by Xt. I think the application base load on this processor was > 10% of the CPU which was put down to act of maintaining the displayed > picture. We are just migrating from Verdix Ada83 to ObjectAda 95 compiler. In both cases we use HP-UX OS. The load problem occurs even when I only monitor one single UNIX socket by means of XtAppMainLoop although there are no events on this socket. When I disable all other tasks in the application, there is no CPU load. On the other hand, running all application tasks but the task with the XtAppMainLoop does not cause CPU load, either. It is only the combination which causes the problem. Thanks, Juergen > > > We've subsequently migrated to GNAT Ada and SPARC 50s whilst keeping the > same use of Xt, and the base load has reduced consistently (ie < 1%). > > I recall from doing some profiling of the application that the select > function was one of the highest CPU users - In our case, the select > service was the underlying mechanism used by Xt to monitor inputs. I see > others have suggested using select to monitor your sockets, but you may > find that this is what Xt is doing already. > > In summary, it's not obvious that the combination of Ada and Xt should > be a problem. I don't know if you have tried profiling your application, > but that may give you some insight as to where the problem lies. > > Des Walker > Alenia-Marconi Systems --------------F1026C1246C8C20CAADC43DA Content-Type: text/x-vcard; charset=us-ascii; name="juergen.fischer.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Juergen Fischer Content-Disposition: attachment; filename="juergen.fischer.vcf" begin:vcard n:Fischer;Juergen tel;pager:+49.(0)168.6957035 tel;cell:+49.(0)170.1630414 tel;fax:+49.(0)7541.282-299 tel;work:+49.(0)7541.282-387 x-mozilla-html:TRUE url:http://www.avitech.de org:Aviation Management Technologies GmbH;Software Development adr:;;Bahnhofplatz 1;Friedrichshafen;Baden-Wuerttemberg;88004;Germany version:2.1 email;internet:Juergen.Fischer@avitech.de title:Dr. rer. nat. Dipl.-Math. x-mozilla-cpt:;-25792 fn:Fischer, Juergen end:vcard --------------F1026C1246C8C20CAADC43DA--