View Single Post
  #2 (permalink)  
Old 05-16-2008
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,478
Hi,

Quote:
Originally Posted by aozarov View Post
I am reading the ice code related to the network operations and have 2the following questions.

1. BasicStream.java -> I see that you commented out the allocateDirect and use heap buffer instead. Any reason? Our tests shows much better performance for the DirectBuffer as long as it is re-used.
I believe we have experienced problems with direct buffers in the past and decided to disable them. Can you detail the tests where you've seen it perform better? Which Ice, OS & JDK version are you using?

Quote:
2. ThreadPool#read(EventHandler handler) -> After reading the payload size (int size = stream.readInt()). it looks like you are reading from the socket with expectation it will have that content/playload readily available (making the bytebuffer its size and reading with zero timeout). Do I read it correctly and if so how can you guaranty that (the palyload will be available to a non-blocking read)?
No, we don't expect all the data to be available. The read might not complete immediately if not enough data is available on the socket and if that's the case the thread returns to wait on the selector for more data to be available.

Cheers,
Benoit.
Reply With Quote