Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: confusing fork/readline behaviour

by flipper (Beadle)
on Aug 13, 2015 at 18:52 UTC ( [id://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...

Replies are listed 'Best First'.
Re^3: confusing fork/readline behaviour
by afoken (Chancellor) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1138481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-03-29 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found