comp.lang.ada
 help / color / mirror / Atom feed
* Sharing a socket connection
@ 2012-07-31  8:56 Jacob Sparre Andersen
  2012-07-31 10:18 ` Niklas Holsti
  2012-07-31 10:28 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 5+ messages in thread
From: Jacob Sparre Andersen @ 2012-07-31  8:56 UTC (permalink / 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/



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

end of thread, other threads:[~2012-08-07  7:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31  8:56 Sharing a socket connection Jacob Sparre Andersen
2012-07-31 10:18 ` 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

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