bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xargs -p operations out of order!


From: Eric Blake
Subject: Re: xargs -p operations out of order!
Date: Wed, 31 Jul 2013 11:10:07 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 07/31/2013 11:01 AM, address@hidden wrote:
> What good is this?
> 
> $ seq 111|xargs -n 5 -p
> echo 1 2 3 4 5 ?...
> echo 6 7 8 9 10 ?...
> echo 11 12 13 14 15 ?...y
> echo 16 17 18 19 20 ?...11 12 13 14 15
> 
> You need to do the operation first before issuing the next prompt!

Sorry, but this is not xargs' fault.  You asked xargs to spawn multiple
processed in parallel, and it is up to the kernel which of those
processes gets scheduled first (they are competing with one another).
Furthermore, since each of those processes all want access to the same
terminal, there is no sane way to guarantee which of the processes will
get there first.  This is not an xargs bug.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]