![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how i prepare a c++ code(c code) for implementing my own protocol format | amitpansuria | High Level Programming | 1 | 09-07-2007 12:09 AM |
| return code of a process | filedeliver | High Level Programming | 1 | 04-19-2007 02:42 AM |
| return code of a process | filedeliver | UNIX for Advanced & Expert Users | 1 | 04-18-2007 04:27 PM |
| background process return code | Vikas Sood | Shell Programming and Scripting | 5 | 06-10-2006 10:25 AM |
| server based Including additional code > Lycos way | valentijnb | UNIX for Dummies Questions & Answers | 1 | 07-05-2003 07:54 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I am just wondering on which is the best way to write programs on UNIX. Which one is better from below:
a) Spawning threads per client connection/request? b) fork-exec new processes per client connection/request? Assume that I am doing some database system on linux which is supposed to run on unix systems as well. The basic differences as I know are: Using processes - have it's own address space, communicate using SysV/POSIX shared memory + semaphores etc & context switching is costly. Also implementing processes instead of threads is that process are more stable and reliable than threads. Just because if one thread malfunctions, the entire process would break. On the other side, using thread the context switching is less cheaper compared to that of process context switches. No need for shared memory as the memory is shared and accessible by all threads with in the process & hence can avoid costly IPC mechanism's like SysV/POSIX shared memory and semaphores. Instead use simple mutexes and condition variables. Being said all the above, I am still not in a position to decide up on which way to go i.e. use threads or use processes? Please help. Regards Kalyan |
| Bookmarks |
| Tags |
| ipc, processes, threads |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|