Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: pipe fork win32

by BrowserUk (Pope)
on Aug 26, 2012 at 03:30 UTC ( #989779=note: print w/ replies, xml ) Need Help??


in reply to Re^2: pipe fork win32
in thread pipe fork win32

If I change 373 in "print $parent "exit now\r\n\r" x 373;" to 745 (744 hangs) it works.

Hm. I used 373 because that is the lowest value on my system that worked (373 * 11 > 4096), so my system (Vista64) is using a 4096 byte buffer.

I thought all Windows systems used that size. I wonder why yours is using 8k? What version of windows are you running? Are you using a home-built version of Perl? Did you tweak the value?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


Comment on Re^3: pipe fork win32
Re^4: pipe fork win32
by bulk88 (Priest) on Aug 26, 2012 at 13:59 UTC

      It's 4k on perl5.8.9, perl10.1, and 8k on perl5.14.2.

      Looks like p5p decided to change it in PerlIO for some stupid reason.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

      See http://www.nntp.perl.org/group/perl.perl5.porters/2011/02/msg169265.html for the change which apparently came in for 5.14.

      As the author notes 8k is an arbitrary figure. (And arbitrary is always stupid.)

      On every system I've checked -- including various flavours of Windows, one Linux and 1 BSD -- the optimal buffer size for disk IO is 16k or 64k.

      But for pipes and sockets, 4k is already too big for many purposes.

      I guess the best solution would be to expose setvbuf().


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Re^4: pipe fork win32
by ikegami (Pope) on Aug 27, 2012 at 15:34 UTC
    For performance reasons, Perl's buffer was changed from 4K to 8K in 5.14.0. It was also made configurable at build time at the same time.

      Yes

      Unfortunately, it means it is now sub-optimal for all purposes. Too small for best throughput on block IO devices, and too big for streaming and communications.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-09-30 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (377 votes), past polls