From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,ad26e6e70c712fe9,start X-Google-Attributes: gidfee84,public From: trin0008@ermine.ox.ac.uk (Rick Heylen) Subject: Kernel multithreading. Date: 1997/03/17 Message-ID: <5gju7p$i2e@news.ox.ac.uk>#1/1 X-Deja-AN: 226355704 Organization: Oxford University, England Newsgroups: comp.unix.osf.osf1 I'm writing a multithreaded program on a 4 CPU Digital UNIX 4.0 system. When I view the running process using ps -m I see that two extra threads are created by any process compiled with cc -pthread. I presume that they babysit any threads the user creates explicitly. I can bind the threads to cpus and they do appear to be bound when viewing with ps -m -Opsr but the percentage cpu usage is never above 100%. In other words, the multithreading is not taking advantage of the multiprocessor nature of my machine and runs very slowly. Can somebody please explain how the threading is implemented please? One of the sysadmins mentioned something about a change in the implementation of multithreading with the new POSIX or something so I accepted that real multiprocessor multithreading might be impossible. I see however that dxmandel found in /usr/bin/X11/demos/dxmandel does multithread properly. erm0>ps -mp 8376 -Opcpu PID %CPU S TTY TIME COMMAND 8376 216.1 R N ?? 15:03:04 dxmandel 0.0 I N 0:00.15 0.0 I N 0:00.00 44.2 R N 03:44:58 0.0 I N 0:00.16 49.1 R N 03:46:17 48.1 R N 03:46:45 74.7 R N 03:45:02 I would like to know how to make my multithreaded programs run properly over multiple processors. Can anybody help? Rick -- All I could see was the B-side of the disc which had assumed an oval shape with the label on the outside rim. PGP key 512/CA5CADED Differential Cryptanalyst and C/C++, Java Programmer Key fingerprint = 00 00 00 00 00 65 AB 2F 76 EB EF F7 9C 10 FA 88