But that brings up an important question: can PDL exploit Perl's new CoW
flags?

On Thu, Sep 18, 2014 at 5:38 PM, David Mertens <[email protected]>
wrote:

> I am 99.9% certain that with PDL, we handle all of our own allocations
> internally. That is, we allocate memory and then copy contents for all of
> our operations. The only situation where CoW might effect PDL is if you use
> get_dataref and somehow expect that to copy the binary data for you...
> something I can't imagine any PDL code doing.
>
> David
>
> On Thu, Sep 18, 2014 at 11:17 AM, Chris Marshall <[email protected]>
> wrote:
>
>> The only data point I have is that kmx just released the
>> Strawberry Perl 5.20.1.1 with a SPP + PDL and, presumably,
>> the tests pass for that build.  I admit I haven't seen the CoW
>> information as to how it affects XS programming.
>>
>> --Chris
>>
>>
>> On Thu, Sep 18, 2014 at 10:05 AM, Niels Larsen <[email protected]> wrote:
>> > PDL list,
>> >
>> > Perl 5.20 has copy-on-write (cow) enabled by default. This feature
>> > means that copying for example one string to another
>> >
>> > $str2 = $str1;
>> >
>> > does not do the copying, but delays it until a perl operator alters
>> > $str2. This again means that if a C-routine linked to Perl modifies
>> > $str2, then the changes appear in $str1. That can be prevented
>> > by forcing it at the C-level by using the Perl API, but often it is not
>> > possible or even a good idea to modify, say, someone else's
>> > C-library. I have not found a Perl way to force the copy, except by
>> > doing silly things like this,
>> >
>> > $str2 .= "";
>> >
>> > or compiling with -Accflags='-DPERL_NO_COW', an option which is
>> > to be removed, they say. There ought to be a run-time configure
>> > option that changes the behaviour, or some other way at the Perl
>> > level. This cow-thing hits my mixed Perl/C code badly, but is PDL
>> > affected too?
>> >
>> > I have not yet reported the problem and found no complaints with
>> > Google, so maybe I missed something. Or have the Perl people
>> > forgotten about Inline .. ?
>> >
>> > Niels L
>> >
>> >
>> >
>> > _______________________________________________
>> > Perldl mailing list
>> > [email protected]
>> > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>
>
> --
>  "Debugging is twice as hard as writing the code in the first place.
>   Therefore, if you write the code as cleverly as possible, you are,
>   by definition, not smart enough to debug it." -- Brian Kernighan
>



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to