# Multi Core Programming, Threads, Process, Apple's Grand Central Dispatch



## susanth (Jun 18, 2009)

Hi FreeBSD Friends,

FreeBSDs Performance & Development on SMP Shows that it 
is a Promising OS for Developing Applications that 
Utilizes Multicore CPUs.

The Document "FreeBSD 7.0 and beyond" available @ 
http://people.freebsd.org/~kris/scaling/7.0 and beyond.pdf
clearly mention the SMPng project, various steps involved, 
the Application performance Graphs of PostgreSQL & MySQL, ... more.

In the above mentioned document, page 15/30 mentions :
>> ?The degradation above 8 threads is due to scaling problems
   within MySQL (not a FreeBSD kernel issue)
>> Ultimately a MySQL architectural problem
>> NB: On this benchmark PostgreSQL is 35% - 45% faster than 
   MySQL at all loads

This shows that : From a User Land Application Developers 
view, In order to get better performance from a Multi Core 
CPU Platform, Good Software (Application) Architecture is 
must. Especially THREADS vs PROCESS.

Recently, I read about Apple's Grand Central Dispatch from 
http://www.apple.com/macosx/technology/
and
http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf

We are planning to Develop a LARGE SCALE Multi Level Marketing
(MLM/Network Marketing) Web Server Based Application, 
Using : C++ in a Environment Supported by :
* FastCGI
* Web Server (Apache, Lighthttpd, NGiNX)
* Database (PostgreSQL, MySQL)
* OS (FreeBSD, LINUX, *NIX)

Our Aim is to develop a rock solid Application that Utilize
SMP on FreeBSD AMD64 Server Platform. Also it will be good 
if we could write it in a portable way so that; Compatible 
with LINUX & other leading *NIX.

We would like to know the following :
=====================================
1. General Guidelines / Bottle Necks / Do(s) n Dont(s) 
    on SMP based Application development

2. Standard Tools for Developing, Testing, Debugging 
    and Deployment

3. Standard and Portable way of developing SMP Application 
    through FreeBSD, LINUX, and all standard *NIX

4. Documents/Tutorials/Books/URL on SMP for Beginner, 
    Intermediate and Advanced Developer

5. The Best way of Developing SMP based Application 
    "EXCLUSIVELY ON FreeBSD" (no problem in Discarding Compatibility 
    with LINUX or Other *NIX, if required)

6. Suggestion on using Standard Portable "Threading library" 
    (e.g. Boost.Thread, ...) vs "Plain OS(FreeBSD) API"

7. Design guidelines in software architecture to scale the 
    Application into a CLUSTERED Computing Environment.

8. FreeBSD's Approach to SMP vs Apple's Grand Central 
    Dispatch (Least important: but just for Curiosity Sake Only)

Yes. We are googling for the required information. 

But Comments/Advice/Suggestion from Experienced Developers 
(especially : SMP Userland Application Developers) are more 
valuable.

Since Multi Level Marketing (MLM/Network Marketing) Applications
should be designed to face large user base/complex-computing/high-scalability:

Valuable expert voice will help us to eliminate big bottle neck or 
roadblocks just because of wrong choice or ignorant use of technology.

*Thanks in Advance for your precious TIME and TALENT Share.*

susanth++;


----------



## susanth (Jul 3, 2009)

*Few visited links*

@ Reasoning behind process instead of thread based ( http://archives.postgresql.org/pgsql-general/2004-10/msg01331.php )

@ About Clustering ( http://www.clustermonkey.net/ )

@ Beowulf ( http://www.beowulf.org/overview/faq.html )

@ The OpenMP API specification for parallel programming( http://openmp.org/wp/about-openmp/ )

@ PVM ( http://www.csm.ornl.gov/pvm/pvm_home.html, http://pvm-plus-plus.sourceforge.net/ )

@ MPI (http://www.open-mpi.org/, http://www.mcs.anl.gov/research/projects/mpich2/ )

@ Boost Concurrent Programming Lib( http://www.boost.org/doc/libs/1_39_0/libs/libraries.htm#Concurrent )

@ FastCGI ( http://www.fastcgi.com/drupal/node/5 )


----------



## susanth (Oct 24, 2009)

*A good book*

Hi friends, 

At last i landed on : The Art of Concurrency by Clay Breshears

http://www.amazon.com/The-Art-of-Concurrency-ebook/dp/B002L4EXD8

//susanth++


----------



## fabiokaminski (Jul 9, 2010)

multicore eficiency is the modern gold rush of computer science 

im trying apple`s libdispatch on BSD ... lets see if this is really hot..


----------



## fidaj (Aug 18, 2010)

http://docs.freebsd.org/cgi/getmsg..../freebsd-questions/20100815.freebsd-questions


----------

