comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Sharing a socket connection
Date: Tue, 31 Jul 2012 10:56:21 +0200
Date: 2012-07-31T10:56:21+02:00	[thread overview]
Message-ID: <87hasofgwa.fsf@adaheads.sparre-andersen.dk> (raw)

We are working on a system where a number of Ada tasks are going to
share a single socket connection to a server [1].

The socket connection is bidirectional with requests sent from a client
followed by corresponding responses from the server.  Each client should
only get responses to its own requests.

Our current approach is to encapsulate the socket in a package, and use
a mutex [2] to lock the socket during an entire
send-request-get-response operation.

Greetings,

Jacob

[1] The rationale for this is that the individual tasks only are
    expected to use the server sporadically, and that letting each task
    have its own connection may use too many limited resources on the
    server.

[2] Do the standard libraries include a mutex (I have a vague
    recollection of having seen one, but can't find it), or should we
    just implement it ourselves (or use the one in "Simple components
    for Ada").

-- 
Photo of the day:
                  http://billeder.sparre-andersen.dk/dagens/



             reply	other threads:[~2012-08-07  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31  8:56 Jacob Sparre Andersen [this message]
2012-07-31 10:18 ` Sharing a socket connection Niklas Holsti
2012-07-31 10:28 ` Dmitry A. Kazakov
2012-07-31 11:50   ` Jacob Sparre Andersen
2012-07-31 12:09     ` Dmitry A. Kazakov
replies disabled

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