2

I am now using GNU parallel in company's project,I wonder if a shell function written like this will use the multicore?

shell_function arg1 arg2 &

shell_function arg3 arg4 &

shell_function arg5 arg6 &

this will using multicore?

0

1 Answer 1

0

Using & splits not just a new thread, but a whole new process. As such, these processes can indeed be assigned to different CPU cores (or, in multisocket environments, different CPUs).

However, note that these processes now have their own copies of local variables, and can no longer modify shell or environment variables inside the parent shell. As such, in many respects they behave more like entirely separate scripts than like regular function calls.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.