From owner-freebsd-questions@FreeBSD.ORG Wed Mar 17 19:31:16 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A86CD1065672 for ; Wed, 17 Mar 2010 19:31:16 +0000 (UTC) (envelope-from Ggatten@waddell.com) Received: from mailhost0.waddell.com (mailhost0.waddell.com [12.154.38.61]) by mx1.freebsd.org (Postfix) with ESMTP id 683378FC13 for ; Wed, 17 Mar 2010 19:31:16 +0000 (UTC) Received: from emlpfilt2.waddell.com (emlpfilt2.waddell.com [10.1.10.30]) by mailhost0.waddell.com (Postfix) with ESMTP id 7007050841; Wed, 17 Mar 2010 14:29:05 -0500 (CDT) Received: from emlpfilt2.waddell.com (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 938112F8001; Wed, 17 Mar 2010 14:31:05 -0500 (CDT) Received: from advpexv0.wradvisors.com (advpexb1.wradvisors.com [192.168.203.21]) by emlpfilt2.waddell.com (Postfix) with ESMTP id 806C02F8004; Wed, 17 Mar 2010 14:31:05 -0500 (CDT) Received: from ADVPHTCAS0.wradvisors.com ([192.168.203.228]) by advpexv0.wradvisors.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 17 Mar 2010 14:30:21 -0500 Received: from WADPMBXV0.waddell.com ([169.254.1.205]) by ADVPHTCAS0.wradvisors.com ([192.168.203.228]) with mapi; Wed, 17 Mar 2010 14:30:21 -0500 From: Gary Gatten To: 'Adam Vande More' , "Zepeda, Herbey" Date: Wed, 17 Mar 2010 14:30:20 -0500 Thread-Topic: multicore processing question Thread-Index: AcrGBnRcQz4Pdh4WQyqWLmOXEo/DHgAAcD2A Message-ID: <9280_1268854265_4BA12DF9_9280_37_2_D9B37353831173459FDAA836D3B434994A3342CC@WADPMBXV0.waddell.com> References: <10E075E52DED228526F5ECAB@utd65257.utdallas.edu> <4BA10BEA.1060303@wallnet.com> <6201873e1003171216q40e102dev23b6059f22e92b8@mail.gmail.com> In-Reply-To: <6201873e1003171216q40e102dev23b6059f22e92b8@mail.gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 17 Mar 2010 19:30:21.0620 (UTC) FILETIME=[48C21F40:01CAC608] Cc: "freebsd-questions@freebsd.org" Subject: RE: multicore processing question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 19:31:16 -0000 Thanks for posting the link to GCD. Interesting info is always welcomed! Gary -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@f= reebsd.org] On Behalf Of Adam Vande More Sent: Wednesday, March 17, 2010 2:17 PM To: Zepeda, Herbey Cc: freebsd-questions@freebsd.org Subject: Re: multicore processing question On Wed, Mar 17, 2010 at 1:02 PM, Zepeda, Herbey w= rote: > Hi, > > I'm relatively new to FreeBSD and have had a hard time get to the right > information relating multicore processing. I hope someone can give me some > pointers. > > I have a two core processor and FreeBSD (latest stable release). > > Question: > > If I have a c program that creates child processes with fork and exec (in= a > non blocking way), will the child processes be executed by FreeBSD in > parallel using the different cores without me having to do special > synchronization arrangements to my program? > Well probably...processes are automatically on SMP kernels so a basic example is if you have 2 cores and 2 processes which are each utilizing 100% of cpu time, then each process would be assigned to a separate core. However in practice executions states are much more complicated and both processes may be assigned to a single core under certain conditions eg one is in a sleep state. The short story is this is all handled automatically, and many applications run just fine without any further tweaking > Will I need threads instead of processes? > Really depends on your need, but in general properly creating threaded safe applications is significantly harder(at least to my understanding, I don't do it). If you need to use this route, you can check out http://www.osnews.com/story/22152/Apple_Releases_Grand_Central_Dispatch_as_= Open_Source It's available on FreeBSD. --=20 Adam Vande More _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
"This email is intended to be reviewed by only the intended recipient and may contain information that is privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any review, use, dissemination, disclosure or copying of this email and its attachments, if any, is strictly prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this email from your system."