Reputation: 3
I'm writing small utility app (JBoss Netty based) which should perform some trivial login against http requests.
Imagine an image buffer
private static byte[] image = DatatypeConverter.parseBase64Binary("...some base64 data here....");
private static final ChannelBuffer imageBuf = ChannelBuffers.wrappedBuffer(image);
So, the question is: Is it correct to share this imageBuf
across multiple threads for writing? Or should I create the new one for each response?
Upvotes: 0
Views: 414
Reputation: 23567
Nope its not safe to share the ChannelBuffer accross Threads. ChannelBuffer's are not thread-safe
Upvotes: 1