On Thu, Jun 7, 2012 at 12:59 PM, Han Boetes <hboe...@gmail.com> wrote: > I just ran a script converting a bunch of files to mp3 and since I have > a 8 core machine now I'd like to make my little script multi-threaded. > So each resulting lame process will go to another core.
All released versions of OpenBSD use user-space threads, which multiplex all threads in a process into a single schedulable kernel entity. On such a system, you must use multiple processes instead of multiple threads if you want to spread the load across multiple CPUs. In -current, we've switched to rthreads, a 1:1 threading implementation. On such a system, a multi-threaded process will have its threads spread across multiple CPUs. You didn't provide a dmesg or even say what version you're running. Oh well. > When I ran the script I noticed that all processes ended up being run on > the same processor. The next instance of the script also ran on the same > processor. It was nu until I started a new shell they moved to another > processor. > > So apparently each process and all it's children are being run on the > same processor. Nope, that's not true. > Is there a setting which changes this behaviour so each child process > goes to a random core? Nope. > Would it be nice if there was a program like taskset which enables you > to move processes to other cores? No. Philip