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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: What exactly is the licensing situation with GNAT? Date: Fri, 21 Nov 2014 10:38:06 +0100 Organization: cbb software GmbH Message-ID: <1u2gy6fhz9fpr$.vzj1o4ueae0g$.dlg@40tude.net> References: <87389olqie.fsf@ixod.org> <19fa65d4-72c9-44ab-b44b-4ea0929c18f2@googlegroups.com> <25731193-c0b5-4ab7-87ff-ba8c6a42cdbd@googlegroups.com> <1se4bvo6gaqft.16cfjaiketlz0$.dlg@40tude.net> <13efsbp4ynti1.1qsb6buqa4a60.dlg@40tude.net> <1lxkqa97hflr0.1c0bm39tzl8ty$.dlg@40tude.net> <2k62zlcocx1l$.1cg687ltl85l9.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: nyHeW7QjJmC1odUjK4LkDA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:23598 Date: 2014-11-21T10:38:06+01:00 List-Id: On Thu, 20 Nov 2014 15:23:14 -0600, Randy Brukardt wrote: > But you seem to have missed my point: in Janus/Ada, task blocking is > irrelevant. If a task blocks in an Ada sense, that just causes the task > supervisor to select a different task to run. I see. But how a Janus/Ada task could use blocking sockets then? > (4) A socket write blocks when it reports that it can accept data. This > should be rare (it would mainly occur if some buffering issue came up, and > we write relatively small amounts of data at a time to reduce the likelyhood > of overfilling buffers). A non-blocking socket should accept as much data it can and then immediately return. > The cost difference suggests that polling is cheaper (for Janus/Ada, which > doesn't give up its slice easily) than waiting for Windows to send a > notification that data is ready, even though the basic mechanism is pretty > similar. That happens only if all sockets are not ready and thus should not impose any overhead. > (After all, Claw polls Windows for notifications, so the effect is > essentially the same at the low level.) I had to assume that there was some > massive expense associated with the non-blocking sockets notifications > inside of Windows -- profiling showed that the CPU load wasn't in the Ada > code (not even in the interface code). I gave up at that point and switched > back to basic polling with blocking sockets. If notification was done per Windows messages mechanism then certainly yes, this is a heavy burden. However usually all notification is just pulsing an event associated with the socket. Single pulse event is shared by all sockets to wake up a thread that then restarts polling sockets status. I don't know how much overhead is in signaling an event. It should not be much. > As I said, the situation would be very different for GNAT, where each worker > task is a different thread. That would most likely block each worker task > early for a polling implementation, so hardly anything would be counted. In > which case your concern would have been justified. But I didn't run this > test with GNAT. And it would be an awful kind of server design anyway... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de