Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Are threads bad? - was: Future of Pypy? Date: Mon, 23 Feb 2015 22:23:46 -0800 Organization: A noiseless patient Spider Lines: 9 Message-ID: <87h9ubakul.fsf@jester.gateway.pace.com> References: <87fv9xdb22.fsf@jester.gateway.pace.com> <54ea7ff4$0$12983$c3e8da3$5496439d@news.astraweb.com> <87zj85bcyu.fsf@jester.gateway.pace.com> <87lhjpb89i.fsf@jester.gateway.pace.com> <87h9udb1eq.fsf@jester.gateway.pace.com> <87bnkkb22u.fsf@jester.gateway.pace.com> <87lhjnang1.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="0e072597111c5029870b25b8e5ee5406"; logging-data="10836"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MS2uFyfaivRNvlpUx0YBf" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:KZxvHZSJuOsi3FRzKQ6mB4ELXoI= sha1:KKHBuKd0UPzr5jncwzMIlXIcxoE= Xref: csiph.com comp.lang.python:86299 Chris Angelico writes: > Actually, you can quite happily have multiple threads messing with the > underlying file descriptors,... The problem is *buffers* for stdin > and stdout, where you have to be absolutely sure that you're not > trampling all over another thread's data structures. Oh ok, sure, yeah, the distinction is valid. I guess the classic interleaved "print 'a'" "print 'b'" loops could crash if the stdio structures get corrupted through conflicting updates somehow.