[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Remoting - Client Asynchronous Calls
by ovidiu.feodorov@jboss.com
genman wrote :
| "2. Synchronous raw send" - In general, I find APIs that use byte[] sort of cumbersome. Its brother "send(byte [], int off, int len)" is better, but still ugly. I would avoid that sort of thing. Using actual objects is better. I mean, if you really want to optimize things, have your objects implement Externalizable. I don't see how "instanceof" and a cast would be slow.
We most likely won't have any send(byte[]), but an sent(ByteBuffer) or equivalent instead. There's a vigorous discussion on this subject going on here: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=92869
The point in contention is whether to offer this as a top level API call, or make it accessible via a "chained marshaller" mechanism Tom Elrod is experimenting with as we speak. We're supposed to have a conference to discuss this, some time mid week. If interested, I can send you the call info.
genman wrote :
| "4. asynchSend" - I can't see how this is different than "invokeOneWay" I guess you say that, but still suggest adding it?
I like symmetry. However, adding a new method name doesn't make too much sense if the current one provides the behavior we need, so I guess I won't make too much noise over that.
The document is just a proposal, it's not etched in stone :).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980253#3980253
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980253
19 years, 5 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Messaging and Remoting
by ovidiu.feodorov@jboss.com
Tim wrote :
| This doesn't make any sense to me.
| NIO and streams don't work well together.
|
Where exactly did you see the word "stream" in the Remoting API extension document?
Tim wrote :
| ovidiu.feodorov(a)jboss.com wrote :
| | Not necessarily, the Remoting implementation can create ByteBuffers by wrapping the byte[] we send as an argument without copying anything, but I don't see any problem with using ByteBuffer instead of byte[] in the method signature.
| |
|
| I don't think wrapping the buffer around a byte[] works with direct byte buffers.
|
The memory allocated when creating a direct buffer is outside of the JVM heap. The allocation is done through native methods, and it's likely to be significantly more expensive than creating non-direct buffers.
I am not saying that we shouldn't use ByteBuffers for the low-level access API, I am saying that we should be very careful how we handle them, and what kind of buffers we pass around, so the drawbacks don't outweigh the speed advantages obtained by having I/O devices writing directly in the memory areas managed by direct buffers.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980227#3980227
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980227
19 years, 5 months