003 Linux System ProgrammingIssues, queries and suggestions related to Linux, Linux Programming, IPC, Interprocess Communication, Synchronization, Semaphore, System Programming, Linux Software Development. » 003.11.POSIX-Threads
Following are the difference between process and threads :
1)Memory_sharing:In multi-threaded program all thread shares same memory space including heap global variable file descriptor .while each process has its own address .
2)Hardware utilization: Process run as a whole on single core of CPU at one time but thread run concurrently on diff core of cpu thereby effectively utilizing resources.
3) communication techniques: Since each Thread shared data segment so they can communicate each other using shred variables while process needs some or more IPC techniques to communicate.
4)Creation overhead:Thread creation is less resources extensive as compared to process because thread shared memory and process context