wsry edited a comment on pull request #18173:
URL: https://github.com/apache/flink/pull/18173#issuecomment-1003018820
>
@pnowojski When writing code for this, I find that in local buffer pool
there is no method which really needs to acquire the network buffer pool lock.
So always locking the network buffer pool lock when call the network buffer
pool method may incurs extra overhead. I am not sure if I understand your
proposal correctly, do you mean we should only pass the network buffer pool
lock to local pool and lock it if needed (currently, no method need to lock it).
BTW, if we always lock the network buffer pool lock, the code becomes a
little complicate, for example:
synchronized (factoryLock) {
synchronized (availableMemorySegments) {
// do something
}
}
and other readers may not know why we add the network buffer pool lock,
because it is not needed.
What do you think if we just pass the network buffer pool lock to local
buffer but not use it currently, and add some comment to explain that one need
to lock the network buffer pool lock first if he/she calls some network buffer
method which needs the lock if he/she is in local buffer pool lock?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]