Is this existing legacy code that you are trying to update or a new application? In either case, does you compiler have an option to choose a different run time (GNAT and Rational Apex typically do depending on the platform). It is certainly possible to get things to work with the process level blocking tasks but for certain classes of problems it does make your life more difficult..(Note that this may not be one of them. I don't think we have enough info to tell yet).. "Juergen Fischer" wrote in message news:3A7A84C3.2486A6CF@avitech.de... > Hi, > > the problem is that we don't have the runtime that blocks on the task level but only > on the process level. > Therefore we have to use non blocking sockets. The XtAppMainLoop does really poll, > but from other C programs we know that it doesn't take much CPU load. So we suppose > that the CPU load is caused by > Ada tasking in combination with the XtAppMainLoop. > > Who has already used XtAppMainLoop within an Ada program? > > Juergen > > Stephen Leake wrote: > > > 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 >