Date: Wed, 17 Mar 2010 14:30:20 -0500 From: Gary Gatten <Ggatten@waddell.com> To: 'Adam Vande More' <amvandemore@gmail.com>, "Zepeda, Herbey" <Herbey.Zepeda@atg.in.gov> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: RE: multicore processing question Message-ID: <9280_1268854265_4BA12DF9_9280_37_2_D9B37353831173459FDAA836D3B434994A3342CC@WADPMBXV0.waddell.com> In-Reply-To: <6201873e1003171216q40e102dev23b6059f22e92b8@mail.gmail.com> References: <10E075E52DED228526F5ECAB@utd65257.utdallas.edu> <4BA10BEA.1060303@wallnet.com> <C6A52E61C3F4D343A9AE1268D8FD359303CE566CCA@atgind05f-as026.atg.in.local> <6201873e1003171216q40e102dev23b6059f22e92b8@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <Herbey.Zepeda@atg.in.gov>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" <font size=3D"1"> <div style=3D'border:none;border-bottom:double windowtext 2.25pt;padding:0i= n 0in 1.0pt 0in'> </div> "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." </font>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9280_1268854265_4BA12DF9_9280_37_2_D9B37353831173459FDAA836D3B434994A3342CC>