Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: confusing fork/readline behaviour

by flipper (Beadle)
on Aug 13, 2015 at 18:52 UTC ( #1138481=note: print w/replies, xml ) Need Help??


in reply to Re: confusing fork/readline behaviour
in thread confusing fork/readline behaviour

Ah that makes sense, thanks. Presumably my script above is unsafe in the general case - I imagine libc could readahead 4k and not finish on a line boundary, then the second process would call readline and start halfway through a line...
  • Comment on Re^2: confusing fork/readline behaviour

Replies are listed 'Best First'.
Re^3: confusing fork/readline behaviour
by afoken (Canon) on Aug 14, 2015 at 18:22 UTC
    Presumably my script above is unsafe in the general case - I imagine libc could readahead 4k and not finish on a line boundary, then the second process would call readline and start halfway through a line.

    Correct.

    Why do you want two processes to read the same file?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2020-02-29 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (128 votes). Check out past polls.

    Notices?