Re: Jython buffer protocol

Jim Baker <[email protected]>
Newsgroups gmane.comp.lang.jython.devel
Message-ID <CAOhO=aNjVLRd7ATyO64noHHwVh7Qe-rMbbXfc-EWoFAKq33oCA@mail.gmail.com>
Jeff,

I think the change looks good other than one small nit - the following new
files use Windows-style line endings:

   - src/org/python/core/buffer/Base1DBuffer.java
   - src/org/python/core/buffer/BaseArrayBuffer.java
   - src/org/python/core/buffer/BaseNIOBuffer.java
   - src/org/python/core/buffer/SimpleNIOBuffer.java
   - src/org/python/core/buffer/Strided1DNIOBuffer.java
   - tests/java/org/python/core/ByteBufferTestSupport.java
   - tests/java/org/python/core/PyBufferNIOTest.java


It makes sense for me to get this into the long delayed 2.7.1 - I do not
see this change impacting any users, and it will clean up buffer protocol
support. The alternative is that we have this change sit around and "bit
rot" - not a good situation!

Please merge away, with an updated NEWS entry, once the line endings are
fixed.

Thanks!

- Jim


On Wed, Aug 24, 2016 at 1:40 PM, Jim Baker <[email protected]> wrote:

> Jeff,
>
> Sorry, thanks for pinging about this. I will take a look today and get
> back to you on that change.
>
> Other people on this list: feel free to bug me if I miss something. I'm a
> very poor implementation of a select loop - always dropping things... But
> retries usually get through.
>
> - Jim
>
> On Wed, Aug 24, 2016 at 4:02 AM, Jeff Allen <[email protected]> wrote:
>
>> Jim & all:
>>
>> I feel this has been sitting off to one side long enough. Do we feel safe
>> that I can merge the underlying work?
>>
>> https://bitbucket.org/tournesol/jython-nio
>>
>> I'll write a short paragraph for NEWS as the last change. On a trivial
>> matter of technique, that para goes above the "Jython 2.7.1rc" heading,
>> ready for an rc2 heading above that when we get there, right?
>>
>> Jeff
>>
>> Jeff Allen
>>
>>
>> On 19/07/2016 21:00, Jeff Allen wrote:
>>
>>> Thanks Stefan: nothing obviously crazy about the concept then.
>>>
>>> I'll take others' advice (Jim?) on whether this kind of change is too
>>> much for 2.7.1, or feels safe.
>>>
>>> Concerning loops with calls in them, there's always an implementation
>>> like that near the base of the hierarchy so that the non-contiguous case
>>> is catered for, then the option (which I like to take up) of using a
>>> bulk method in the contiguous sub-class. If we suddenly wanted to
>>> support CopyTo/From ByteBuffer in the API, implementing it efficiently
>>> could follow along.
>>>
>>> Main thing is you have your buffer protocol interface onto non-heap
>>> storage to try when you can.
>>>
>>> Jeff
>>>
>>> Jeff Allen
>>>
>>> On 17/07/2016 15:26, Stefan Richthofer wrote:
>>>
>>>> Hello Jeff,
>>>>
>>>> sorry for the delay. I was (and still am) busy with adding NumPy
>>>> support and it turned out that NumPy is okay with PyMemoryView_FromObject
>>>> returning null for now (I suppose it has a fallback for that). It actually
>>>> does call that method which is why I thought buffer protocol (which
>>>> PyMemoryView_FromObject is based on) would be an urgent need for NumPy
>>>> support. Of course I still want to add buffer protocol to JyNI, but won't
>>>> find time to look at this before NumPy support moved on some more. So I did
>>>> not yet take a detailed look at your work. However my main concern there
>>>> would be to avoid that any index-iterating (NIO-bridge-)method would
>>>> perform method calls within a loop, but instead is implemented using
>>>> bulk-access methods. If this is already the case I would most likely have
>>>> no further concerns.
>>>> Thanks for adding getObj(); this is useful in any case.
>>>>
>>>> Do you think this would be bloat, nice-to-have, or really useful for
>>>>> what you were hoping to do?
>>>>>
>>>> This sounds like it is mainly relevant for Java-integration and not so
>>>> much for JyNI. Spontaneously I'd give it a "nice to have".
>>>>
>>>> To give you some definite clue regarding my time-management: I will
>>>> resume work on BufferProtocol-front after
>>>> a) Jython 2.7.1 was released
>>>> b) JyNI 2.7-alpha.4 was released.
>>>>
>>>>
>>>> Best,
>>>>
>>>> Stefan
>>>>
>>>>
>>>> Gesendet: Freitag, 15. Juli 2016 um 09:42 Uhr
>>>>> Von: "Jeff Allen" <[email protected]>
>>>>> An: "Stefan Richthofer" <[email protected]>
>>>>> Cc: "Jython Developers" <[email protected]>
>>>>> Betreff: Re: [Jython-dev] Jython buffer protocol
>>>>>
>>>>> Stefan:
>>>>>
>>>>> I recently pushed more changes to my bitbucket fork, including addition
>>>>> of a getObj() to PyBuffer in response to your need to navigate to the
>>>>> exporting object.
>>>>>
>>>>> The existing PyBuffer interface provides copyTo/From byte arrays. With
>>>>> support for non-heap NIO storage it seems natural (and not too hard) to
>>>>> add copyTo/From ByteBuffer. At present these are in the NIO
>>>>> implementation, but not made interface items. Do you think this would
>>>>> be
>>>>> bloat, nice-to-have, or really useful for what you were hoping to do?
>>>>>
>>>>> Jeff
>>>>>
>>>>> Jeff Allen
>>>>>
>>>>> On 13/06/2016 01:04, Stefan Richthofer wrote:
>>>>>
>>>>>> Hey Jeff,
>>>>>> thanks a lot for this work. I will take a closer look as soon as I
>>>>>> find time.
>>>>>> However, so far - quickly scrolling through some source-files - it
>>>>>> looks pretty good.
>>>>>>
>>>>>> Best
>>>>>>
>>>>>> Stefan
>>>>>>
>>>>>>
>>>>>>
>>>>>> Gesendet: Samstag, 11. Juni 2016 um 11:37 Uhr
>>>>>>> Von: "Jeff Allen" <[email protected]>
>>>>>>> An: "Stefan Richthofer" <[email protected]>
>>>>>>> Cc: "Jython Developers" <[email protected]>
>>>>>>> Betreff: Re: [Jython-dev] Jython buffer protocol
>>>>>>>
>>>>>>> Stefan:
>>>>>>>
>>>>>>> A sane version of the nio buffer work now exists for your delight at:
>>>>>>> https://bitbucket.org/tournesol/jython-nio
>>>>>>>
>>>>>>> <snip>
>>>>>
>>>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>> traffic
>>> patterns at an interface-level. Reveals which users, apps, and protocols
>>> are
>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>> planning
>>> reports.http://sdm.link/zohodev2dev
>>> _______________________________________________
>>> Jython-dev mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jython-dev
>>>
>>>
>>
>

------------------------------------------------------------------------------

_______________________________________________
Jython-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.