8219014: (bf) Add absolute bulk put methods which accept a source Buffer
Paul Sandoz
paul.sandoz at oracle.com
Tue Feb 11 17:17:16 UTC 2020
> On Feb 10, 2020, at 9:53 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>
>
>> On Feb 7, 2020, at 8:07 AM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>>
>>> On Feb 6, 2020, at 12:30 PM, Brian Burkhalter <brian.burkhalter at oracle.com <mailto:brian.burkhalter at oracle.com>> wrote:
>>>
>>>
>>>> On Feb 6, 2020, at 12:09 PM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
>>>>
>>>> To me the spec is quite straightforward, it should behave as is the relative bulk method adjusting and reverting the positional state.
>>>
>>> That’s the behavior, except that in its present form the proposed method allows the source and target buffers to be the same.
>>>
>>
>> Yeah, i was over simplifying.
>
> On second thought it might be better to disallow the source buffer being the same as the target buffer as in the relative bulk version. That would retain consistency while avoiding potential problems.
>
That feels like taking the easy way out :-) I believe the constraint is there because buffers hold positional state.
Two distinct buffer instances can refer to overlapping regions of virtual memory,
In the case of an absolute bulk put there should be no observable update to positional state of either buffer.
> Also, I agree that removing some code duplication by re-implementing the relative bulk methods to call the absolute bulk methods would be a good idea, but this might better be done as a separate, follow-on issue to this one.
>
Ok.
Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200211/f600778c/attachment.htm>
More information about the nio-dev
mailing list