comp.lang.ada
 help / color / mirror / Atom feed
* GNAT implementation of socket sets
@ 2018-01-19 17:29 Dmitry A. Kazakov
  2018-01-19 19:10 ` Simon Wright
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry A. Kazakov @ 2018-01-19 17:29 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-19 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 17:29 GNAT implementation of socket sets Dmitry A. Kazakov
2018-01-19 19:10 ` Simon Wright

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