thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Shtof <shtof.a...@visionmap.com>
Subject RE: Cancellation of a blocking read operation
Date Mon, 02 Sep 2013 07:09:18 GMT
C++
And we do not do it on the UI thread. Do not worry about it.
But we still want to cancel an existing read operation. We do not want to block a thread forever
and just open a new one for our next communications.

Alex.

-----Original Message-----
From: Jens Geyer [mailto:jensgeyer@hotmail.com] 
Sent: Sunday, September 01, 2013 9:35 PM
To: user@thrift.apache.org
Subject: AW: Cancellation of a blocking read operation

What language? C# has async support, for example.

In general it's not recommended to do any cross machine/network calls in the UI thread, not
only with Thrift.

Have fun,
Jens
________________________________
Von: Alex Shtof
Gesendet: 01.09.2013 14:48
An: user@thrift.apache.org
Betreff: RE: Cancellation of a blocking read operation

I am more concerned about client-side cancellation. For example, I would like to be able to
hit "Cancel" in the UI of my application and all communications with the server will cease.
I believe I am not the first to encounter the need to cancel thrift-based communications.
Is there any other solution you might think of? I haven't seen any support for cancellation
thrift/async headers either.

Alex.

-----Original Message-----
From: Ben Craig [mailto:ben.craig@ni.com]
Sent: Thursday, August 29, 2013 5:09 PM
To: user@thrift.apache.org
Subject: Re: Cancellation of a blocking read operation

There is not a safe, portable way to do that as far as I know.

One common way that this is mitigated is by using a framed transport. Most transports just
send data as soon as it is available.  The framed transport puts the size of a message as
the first four bytes.

On the server side, the framed transport is used by TNonBlockingServer to set up a state machine,
such that you can call interrupt() on the server to tear things down.

There is a good reason that Thrift doesn't support cancellation of individual transport. 
The typical way to implement cancellation is to change every "read()" call into both a "select()"
and a "read()".  This double the number of system calls that need to be made, and does horrible
things to performance.



From:   Alex Shtof <shtof.alex@visionmap.com>
To:     "user@thrift.apache.org" <user@thrift.apache.org>,
Date:   08/29/2013 02:39 AM
Subject:        Cancellation of a blocking read operation



Hi all.
I would like to ask for your help with cancellation of a blocking read operation that is in
progress. The read operation (for example –
TProtocol::readByte) is blocked until the data is received. When I close the transport from
another thread, I get a failed assertion about a null pointer.

Is there any other way to cancel a blocked read operation?

Alex.

This email and any files transmitted with it are confidential and contain proprietary information
belonging to VisionMap Ltd. VisionMap Ltd. asserts in respect of this email and any files
transmitted with it all rights for confidentiality and proprietary interests to the fullest
extent permitted by law. If you are not the intended recipient you are notified that disclosing,
copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited. Thank you.



This email and any files transmitted with it are confidential and contain proprietary information
belonging to VisionMap Ltd. VisionMap Ltd. asserts in respect of this email and any files
transmitted with it all rights for confidentiality and proprietary interests to the fullest
extent permitted by law. If you are not the intended recipient you are notified that disclosing,
copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited. Thank you.

This email and any files transmitted with it are confidential and contain proprietary information
belonging to VisionMap Ltd. VisionMap Ltd. asserts in respect of this email and any files
transmitted with it all rights for confidentiality and proprietary interests to the fullest
extent permitted by law. If you are not the intended recipient you are notified that disclosing,
copying, distributing or taking any action in reliance on the contents of this information
is strictly prohibited. Thank you. 
Mime
View raw message