comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Sharing a socket connection
Date: Tue, 31 Jul 2012 14:09:09 +0200
Date: 2012-07-31T14:09:09+02:00	[thread overview]
Message-ID: <1injxfyfr9r4s.h6s5ke4ev9un$.dlg@40tude.net> (raw)
In-Reply-To: 87pq7c6tfc.fsf@adaheads.sparre-andersen.dk

On Tue, 31 Jul 2012 13:50:31 +0200, Jacob Sparre Andersen wrote:

> Dmitry A. Kazakov wrote:
>> Jacob Sparre Andersen wrote:
> 
>>> 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.
>>
>> This sort of multiplexing will be extremely slow. Basically you block
>> communication until server respond.
> 
> Yes.  Fortunately that is not likely to be a problem for this
> application.

Then I would do just what Niklas suggested.

>> My primary concern would making it full duplex multiplexed. Because
>> half-duplex communication is really one of the major performance
>> killers.
>>
>> I would consider a request [protected] object queued to a dedicated
>> task doing I/O. The object would be waitable for the task that queued
>> it. Which is basically how OS drivers work.
> 
> I'm not sure I understand what you mean.  AFAIK protected objects can't
> queue on entries.

Protected object is basically a signal. You can pass it to a task entry or
queue somewhere. The "driver" picks up a request and initiates I/O (e.g.
sends something to the server). Then it shoves the request to another
queue. Upon receipt, which is typically another task, the task takes the
request and signals it completed. The caller may see nothing of these
transitions just waiting for the event signaled.

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



      reply	other threads:[~2012-08-06 14:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
replies disabled

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