Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

FORTH IF HONK THEN


devel / comp.unix.shell / Let cat use multiple cores for parallel processing.

SubjectAuthor
* Let cat use multiple cores for parallel processing.hongy...@gmail.com
+* Re: Let cat use multiple cores for parallel processing.hongy...@gmail.com
|`- Re: Let cat use multiple cores for parallel processing.David W. Hodgins
`* Re: Let cat use multiple cores for parallel processing.David W. Hodgins
 `- Re: Let cat use multiple cores for parallel processing.Aragorn

1
Let cat use multiple cores for parallel processing.

<9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5237&group=comp.unix.shell#5237

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:622a:191:b0:2f1:ffe6:283c with SMTP id s17-20020a05622a019100b002f1ffe6283cmr4350129qtw.557.1650324465599;
Mon, 18 Apr 2022 16:27:45 -0700 (PDT)
X-Received: by 2002:a05:622a:256:b0:2e1:a01b:a538 with SMTP id
c22-20020a05622a025600b002e1a01ba538mr8696950qtx.167.1650324465403; Mon, 18
Apr 2022 16:27:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 18 Apr 2022 16:27:45 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=203.175.13.189; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 203.175.13.189
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
Subject: Let cat use multiple cores for parallel processing.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Mon, 18 Apr 2022 23:27:45 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Mon, 18 Apr 2022 23:27 UTC

Today, I noticed that some of the discussions here are entitled

```
can the "cat" command use multi-processes"
```

At the bottom of the discussion, I see the following comment and script snippet:

Update On further thought, this will only prefetch up to the pipe buffer size, 64k. The following modification will pull all of the files into memory; if they can't fit, don't use it:
```
#!/bin/bash

fd=3
for file in *
do
eval exec $fd\<<(content=$(<$file); echo "$content")

fd=$((fd + 1))
done

out_fd=3
while [ "$out_fd" -lt "$fd" ]
do
cat <&${out_fd}
out_fd=$((out_fd + 1))
done
```

But I'm still not sure whether I can let `cat` use multiple cores for parallel processing. Any hints will be highly appreciated.

Regards,
HZ

Re: Let cat use multiple cores for parallel processing.

<91ba032d-137f-49e9-9d4c-bedcfe75eb1en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5238&group=comp.unix.shell#5238

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a37:bf04:0:b0:69e:6243:f141 with SMTP id p4-20020a37bf04000000b0069e6243f141mr8028092qkf.229.1650324545552;
Mon, 18 Apr 2022 16:29:05 -0700 (PDT)
X-Received: by 2002:a05:620a:2705:b0:69e:9d34:2305 with SMTP id
b5-20020a05620a270500b0069e9d342305mr4359508qkp.568.1650324545391; Mon, 18
Apr 2022 16:29:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 18 Apr 2022 16:29:05 -0700 (PDT)
In-Reply-To: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=203.175.13.158; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 203.175.13.158
References: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <91ba032d-137f-49e9-9d4c-bedcfe75eb1en@googlegroups.com>
Subject: Re: Let cat use multiple cores for parallel processing.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Mon, 18 Apr 2022 23:29:05 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Mon, 18 Apr 2022 23:29 UTC

On Tuesday, April 19, 2022 at 7:27:48 AM UTC+8, hongy...@gmail.com wrote:
> Today, I noticed that some of the discussions here are entitled

See here [1] for the original discussion.

[1] https://unix.stackexchange.com/questions/81705/can-the-cat-command-use-multi-processes

Re: Let cat use multiple cores for parallel processing.

<op.1kui5p1ia3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5239&group=comp.unix.shell#5239

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: Let cat use multiple cores for parallel processing.
Date: Mon, 18 Apr 2022 20:18:51 -0400
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <op.1kui5p1ia3w0dxdave@hodgins.homeip.net>
References: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="bc88ef1b3a34d8f878d53646b596239a";
logging-data="2397"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cIo4sxiWLgLPIQLj3IZWT1A1+VSyz2BQ="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:boqZf9plmsg30iDs26r2NDUG164=
 by: David W. Hodgins - Tue, 19 Apr 2022 00:18 UTC

On Mon, 18 Apr 2022 19:27:45 -0400, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
> But I'm still not sure whether I can let `cat` use multiple cores for parallel processing. Any hints will be highly appreciated.

The cat command is supposed to concatenate one or more files, optionally with some
modifications such as suppressing repeated empty output lines, and write them to a
single output. The limited processing available in the cat command ensures it will
be i/o bound, not cpu bound. The first bottleneck the cat command has to deal with
is the write speed. Since there is only one output, there is no possible benefit,
and lots of complications, to try to use more than one core.

To even think of using multiple cores for the cat command, strongly suggests you
should be using some other command.

What are you trying to accomplish? Is this just a test question for some course?

Ah. Just noticed your headers. You're using google groups, not usenet. After
a quick search, the thread you're referring to is from 8 years ago, and it's
answered in that thread, that there is no benefit.

Regards, Dave Hodgins.

Re: Let cat use multiple cores for parallel processing.

<op.1kujftfaa3w0dxdave@hodgins.homeip.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5240&group=comp.unix.shell#5240

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: dwhodg...@nomail.afraid.org (David W. Hodgins)
Newsgroups: comp.unix.shell
Subject: Re: Let cat use multiple cores for parallel processing.
Date: Mon, 18 Apr 2022 20:24:55 -0400
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <op.1kujftfaa3w0dxdave@hodgins.homeip.net>
References: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
<91ba032d-137f-49e9-9d4c-bedcfe75eb1en@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="bc88ef1b3a34d8f878d53646b596239a";
logging-data="4328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2VEgBnq1nxEogx3IWJNmkW3MPwY1t1DU="
User-Agent: Opera Mail/12.16 (Linux)
Cancel-Lock: sha1:f1zOAPqnDLcxbEklfD6Hu6YJ/2c=
 by: David W. Hodgins - Tue, 19 Apr 2022 00:24 UTC

On Mon, 18 Apr 2022 19:29:05 -0400, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:

> On Tuesday, April 19, 2022 at 7:27:48 AM UTC+8, hongy...@gmail.com wrote:
>> Today, I noticed that some of the discussions here are entitled
>
> See here [1] for the original discussion.
>
> [1] https://unix.stackexchange.com/questions/81705/can-the-cat-command-use-multi-processes

The cat command is not designed to merge files and is the wrong tool to use to
try and do so.

The sort command has a merge option, which is suitable for use if the files are
each already sorted.

Regards, Dave Hodgins

Re: Let cat use multiple cores for parallel processing.

<20220419122409.0fedbbaa@nx-74205>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5241&group=comp.unix.shell#5241

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: thoron...@telenet.be (Aragorn)
Newsgroups: comp.unix.shell
Subject: Re: Let cat use multiple cores for parallel processing.
Date: Tue, 19 Apr 2022 12:24:09 +0200
Organization: A noiseless patient Strider
Lines: 28
Message-ID: <20220419122409.0fedbbaa@nx-74205>
References: <9c9201d9-af7f-4a43-b8d3-c98323c8cafcn@googlegroups.com>
<op.1kui5p1ia3w0dxdave@hodgins.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: reader02.eternal-september.org; posting-host="4efafe3865403c561e8e59083922df6d";
logging-data="29393"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18M7m5WdbQ7Z3Gu+fkNTD+6"
Cancel-Lock: sha1:BWKNX5aHcI0FI6AK3fIQN8bEeLo=
X-Newsreader: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu)
 by: Aragorn - Tue, 19 Apr 2022 10:24 UTC

On 18.04.2022 at 20:18, David W. Hodgins scribbled:

> Ah. Just noticed your headers. You're using google groups, not
> usenet. After a quick search, the thread you're referring to is from
> 8 years ago, and it's answered in that thread, that there is no
> benefit.

It's Hongyi Zhao, the longstanding resident help vampire. Don't expect
any clarification from him, ever. He only asks questions — whether
on-topic or off-topic, he doesn't care — but he'll never answer any
question asked of him, and he'll never tell you what he's trying to
accomplish.

The worst part is that everyone here in comp.unix.shell is always eager
to reply to him, regardless of what he's asking, just to show everyone
else how well they know the different POSIX standards, without ever
questioning why Hongyi can't be bothered reading the manuals or doing
his own research, not to mention what he's trying to concoct with his
experiments.

And well, ultimately, he's a Google Grouper. That should say it all.
<shrug>

--
With respect,
= Aragorn

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor