comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: GNAT implementation of socket sets
Date: Fri, 19 Jan 2018 18:29:09 +0100
Date: 2018-01-19T18:29:09+01:00	[thread overview]
Message-ID: <p3t9t5$1cvk$1@gioia.aioe.org> (raw)

GNAT.Sockets implementation of Socket_Set_Type has no operation to walk 
that set by position. It seemed not a big issue until I noticed that the 
implementation of

    procedure Get (Item : in out Socket_Set_Type; Socket : out Socket_Type);
    --  Extract a Socket from socket set Item. Socket is set to
    --  No_Socket when the set is empty.

seems to always return the last element of the set.

If so, it imposes a severe problem for an application that deals with 
multiple non-blocking sockets, because it prioritizes connections with 
sockets with greater file numbers. Under heavy load the application will 
serve only one connection.

Typically such issues are resolved by a round-robin schema to balance 
the load. But that requires walking the set and extracting an element at 
a position.

Can anybody confirm that and suggest a workaround?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


             reply	other threads:[~2018-01-19 17:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 17:29 Dmitry A. Kazakov [this message]
2018-01-19 19:10 ` GNAT implementation of socket sets Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox