Re: constrain an app to one core?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail; t=1233411203; bh=JfiK58q4C9Rx/jadxs1NbA3KdUPkC3nPKe2vMtzSb+g=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=bb2TNhh3ojjg t5XYg6LdZgIIWh4fUe+m/wNWZZ+c7L/Y5QlJqElJtukHscjWCgwwCD5vPGNDcVr5Ouv zr0+cyUseyRcEyN6RdMnNr1GTc6QGgsqFgHa/RDRbFi0wBUWAxS1vx87bV2CVwytfc8 fc8EiY18PFK1GQYfFMcTg0awo= User-agent: Thunderbird 2.0.0.16 (X11/20080724) You can use utilBindThreadToCPU(). However, it requires the CHUD tools kext be loaded, so it is not at all appropriate for a shipping product. As somebody else said, it might be best to fix your bug. Drew PS: Here is a hack which binds a program to a CPU: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int cpu = atoi(argv[1]); int ret; chudInitialize(); printf("binding to cpu %d\n", cpu); ret = utilBindThreadToCPU(cpu); if (ret != 0) { fprintf(stderr, "bind failed, return = %d\n", ret); fprintf(stderr, "check that chud kext is installed\n"); fprintf(stderr, "and CPU %d is online\n", cpu); exit(1); } execv(argv[2], &argv[2]); return(0); } _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrew Gallatin