Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7341

Re: How to flush stdin to popen3 without closing it?

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: How to flush stdin to popen3 without closing it?
Date Sun, 26 Feb 2017 22:53:21 +0100
Lines 19
Message-ID <ehh12jF6dltU1@mid.individual.net> (permalink)
References <8760jwkiyv.fsf@filestore.home.gustad.com> <ehgid3F3dm4U1@mid.individual.net> <87h93gd3s7.fsf@filestore.home.gustad.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net WhixsSNO2wMVSeuWi/oKvwGWzBhBDGe3/77WaNlC3DfokCLck=
Cancel-Lock sha1:18QVBs7ubihomggZWdR9oBSp4K0=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
In-Reply-To <87h93gd3s7.fsf@filestore.home.gustad.com>
Xref csiph.com comp.lang.ruby:7341

Show key headers only | View raw


On 26.02.2017 22:46, Petter Gustad wrote:

> Again, thanks!

You're welcome!  Just one more caveat, which might not apply in this 
case but a general advice for #popen and the likes: buffers between 
processes are limited.  If you handle everything single threaded there 
is potential for deadlock.  This will always happen if you send more 
data longer than the buffer size to the pipe and the other process will 
also send more than buffer size data.  Then both are blocked on IO.

Kind regards

	robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar


Thread

How to flush stdin to popen3 without closing it? Petter Gustad <newsmailcomp6@gustad.com> - 2017-02-26 17:36 +0100
  Re: How to flush stdin to popen3 without closing it? Robert Klemme <shortcutter@googlemail.com> - 2017-02-26 18:42 +0100
    Re: How to flush stdin to popen3 without closing it? Petter Gustad <newsmailcomp6@gustad.com> - 2017-02-26 22:46 +0100
      Re: How to flush stdin to popen3 without closing it? Robert Klemme <shortcutter@googlemail.com> - 2017-02-26 22:53 +0100

csiph-web