Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [dsdp-tcf-dev] Response order from tcf agents

Hi Torleif,

Yes, you are right, there can be a separate queue for each channel. In
fact, each channel is a separate message queue by itself - since it
contains data buffers. No ordering is required across channels.

And multithreading can improve performance. However, you need to be
extremely careful with that. Commands can access and modify shared data,
so you will need to protect the data from racing conditions with
mutexes, and then deal with deadlocks. Usually, debug agents have
relatively complicated shared data structures and complicated execution
paths with plenty of call-backs, which makes global multithreading
virtually impossible.

At same time, long running or potentially blocking commands do need to
be executed by separate threads. For that reason, TCF agent code uses
thread pool to perform potentially blocking I/O operations, see
asyncreq.c. The key here is that background threads are local - don't
cross API boundaries. That makes all synchronization mach easier, since
APIs don't need to be thread safe.

Regards,
Eugene

-----Original Message-----
From: dsdp-tcf-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Sandnes, Torleif
Sent: Wednesday, June 24, 2009 2:02 AM
To: DSDP TCF dev list
Subject: RE: [dsdp-tcf-dev] Response order from tcf agents

Hi Eugene.

Thanks for your reply!

After taking a second look at the TCF specification, I see that the
protocol is required to process and respond to commands in the order
they are sent.
Sorry for not doing a thorough reading before posting here.

However, I feel that some of the statements in the TCF specification may
be somewhat ambiguous.

In the paragraph about message ordering it is stated that "The framework
itself is required to preserve message order ". 
>From this statement it seems that the framework *must* have a *single*
queue for processing commands, (as in the Protocol API).
 
But the statement under the requirements section says: 
"For each communication channel between two peers, the framework should
preserve order of commands, results and events."
I take this to mean that there *can* be a separate queue (and
dispatching thread) *for each channel* and that message ordering across
channels need not be preserved.

Which of the two interpretations would you consider most "correct"? 

I am aware that both the API definition and the Java implementation use
a single event queue, but we wish to make the TCF agent responsive on
other channels while one channel is processing a time-consuming command.

Any thoughts?

Regards,
Torleif

-----Original Message-----
From: dsdp-tcf-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Tarassov, Eugene
Sent: 23. juni 2009 21:22
To: DSDP TCF dev list
Subject: RE: [dsdp-tcf-dev] Response order from tcf agents

Hi Torleif,

In TCF, the protocol and implementations MUST process requests relating
to the same remote object (or related objects) in the order in which
they are received. In other words, if a client submits multiple requests
to the agent, the results in the responses MUST be the same as if it had
sent the requests one at a time and waited for the response in each
case.

This allows client to overlap commands execution, which greatly improves
performance.

Command responses relating to the same remote object (or related
objects) MUST have correct order relative to events coming from same
object. This is necessary to maintain data cache coherency on the client
side.

Regards,
Eugene.


-----Original Message-----
From: dsdp-tcf-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Sandnes, Torleif
Sent: Tuesday, June 23, 2009 3:23 AM
To: dsdp-tcf-dev@xxxxxxxxxxx
Subject: [dsdp-tcf-dev] Response order from tcf agents

Hi.

I have recently been working on implementing a tcf agent in c++. 

For various reasons, his agent uses a thread pool to service commands
that enter an event queue and responses can thus be sent to clients in a
different order than commands were received. 

When running the TCF tests from Eclipse, it seems that it is expected
that the order of responses are the same as the order the corresponding
commands were sent. 

Is this really the case? Why aren't the Tokens used to match responses
to commands?

Will any agents that send responses out-of-order be able to use eclipse
as a debug front-end?

Regards,

Torleif Sandnes

_______________________________________________
dsdp-tcf-dev mailing list
dsdp-tcf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tcf-dev
_______________________________________________
dsdp-tcf-dev mailing list
dsdp-tcf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tcf-dev
_______________________________________________
dsdp-tcf-dev mailing list
dsdp-tcf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dsdp-tcf-dev


Back to the top