|
|
|
|||||
|
Hey,guy:
i want use sequence<byte> ByteSeq as Out-Parameters, that also back big data,so i want use array mapping for achieve zero-copy passing of sequences. How deal with it ? TKS. |
|
||||||
|
Hi,
In order to get zero-copy for return values you need to use AMI in your client and AMD in your server. Your slice might look something like Code:
#include<Ice/BuiltinSequences.ice>
module Test
{
interface Iface
{
["ami", "amd"] void getBytes(out ["cpp:array"] Ice::ByteSeq b);
};
};
Dwayne Last edited by dwayne : 09-16-2008 at 01:46 PM. |
|
|||||
|
fast copy
yeah,iGet it,and other trouble is i want copy data like this:
ByteSeq byteSeq(ByteSeqSize); pair<const Ice::Byte*, const Ice::Byte*> byteArr; byteArr.first = &byteSeq[0]; byteArr.second = byteArr.first + byteSeq.size(); how ? ![]() |
|
|||||
|
I'm so sorry about it.
in my project,i use Out-Parameters to get the result,but sometimes,it's huge big,so i try to use sequence<byte> out the result, i define .ice like : sequence<byte> ByteSeq; interface Hello { void sayHello(int delay,out ByteSeq byteSeq); } so just like client send a num,and server out back a big data, now,i have no idea about out back ,it's so big,i want server copy data as soon as he can. In Ice-3.2.1-VC71\demo\Ice\throughput, i found Array Mapping for Sequences,so i think maybe Array can help me to achieve zero-copy passing of sequences. can i do it ? tks. |
|
||||||
|
If you're returning a stack-allocated vector<Ice::Byte> from your servant, then with many C++ compilers, you can take advantage of Named Return Value Optimization (NRVO).
In this case, no need to use AMD to implement your operation: this compiler optimization avoids the vector copying. Cheers, Bernard |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sockets parameters in ICE | gyarmit | Comments | 2 | 06-19-2007 10:32 AM |
| in data with out parameters? | ctennis | Help Center | 1 | 06-29-2006 10:48 AM |
| slice generated classess in c++ and unused parameters | xdm | Help Center | 6 | 01-26-2006 12:31 AM |
| Passing parameters to constructor | jacopo | Help Center | 2 | 05-12-2005 01:47 PM |
| Extracting Network parameters from a proxy object | alfredt | Help Center | 1 | 03-03-2004 08:51 AM |