Re: Examples of concurrent coproc usage?

2024-04-19 Thread Chet Ramey

On 4/17/24 8:55 PM, Martin D Kealey wrote:


On Wed, 17 Apr 2024, Chet Ramey wrote:

On 4/16/24 2:46 AM, Carl Edquist wrote:


But the shell is pretty slow when you ask it to shovel data around like
this.  The 'read' builtin, for instance, cautiously does read(2) calls of a
single byte at a time.


It has to do it that way to find the delimiter on a non-seekable file
descriptor, since it has to leave everything it didn't consume available
on stdin.


Has anyone tried asking any of the kernel teams (Linux, BSD, or other) to
add a new system call such as readln() or readd()?


They'd probably point you to an optimized version of getdelim/getline.
You're just pushing the work down a layer.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: bash parallel build: make[1]: warning: -j16 forced in submake: resetting jobserver mode.

2024-04-19 Thread Cedric Blancher
On Sun, 14 Apr 2024 at 01:24, Dmitry Goncharov  wrote:
>
> On Sat, Apr 13, 2024 at 12:41 AM Cedric Blancher
>  wrote:
> >
> > Good morning!
> >
> > Building bash HEAD on Cygwin 3.5.3 and Debian Linux 11  in make
> > parallel mode issues a warning, which looks like a Makefile bug:
> > $ make -h 16
> > ...
> > make[1]: warning: -j16 forced in submake: resetting jobserver mode.
> > ...
> > Can this be fixed please?
>
>
> It takes a certain makefile setting to cause this warning.
> E.g. -j16 can be specified in the makefile on the recipe line like this
>
> $ ls
> lib  makefile
> $ cat makefile
> all:; $(MAKE) -C lib -j4
> $ cat lib/makefile
> all:;
> $ make -j2
> make -C lib -j4
> make[1]: warning: -j4 forced in submake: resetting jobserver mode.
> make[1]: Entering directory
> '/home/dgoncharov/src/gmake/test/jobserver_reset/lib'
> make[1]: 'all' is up to date.
> make[1]: Leaving directory 
> '/home/dgoncharov/src/gmake/test/jobserver_reset/lib'
> $
>
> Submake detects that it has its own -j switch and it no longer
> participates in the parent make job server.
> Instead, the submake will become a master of its own jobserver and run
> up to 4 (in this example) jobs, and the parent make keep running its
> own job server with up to 2 (in this example) jobs.
> This can also be caused by settings in submake env.
> See https://www.gnu.org/software/make/manual/html_node/Error-Messages.html.
>
> You can check what env the submake in question has and which recipe
> runs it and see where this setting comes from.

We were only using
make -j16 all
at the bash base dir. That should NOT trigger this warning.

Ced
-- 
Cedric Blancher 
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur