Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:01:31+00:00 2026-06-01T01:01:31+00:00

Possible Duplicate: Threads vs Processes in Linux To implement multi-tasks programs we could use

  • 0

Possible Duplicate:
Threads vs Processes in Linux

To implement multi-tasks programs we could use either processes or threads.
My question is how to choose between these methods ?
does it have an effect on system memory or cpu usage ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:01:32+00:00Added an answer on June 1, 2026 at 1:01 am

    If your application will consist of separate, individually-usable components that communicate through well-defined protocols, each of which performs jobs that can individually succeed or fail without complicating the logic of the other components, then it’s perfectly reasonable to write an application that utilizes multiple processes. A good example of an application that could be constructed this way is a MTA (mail transport agent).

    If on the other hand the concurrency will involve lots of shared data/state where continuance of one flow of execution depends on the result of another, you really should be using threads. The biggest advantages of threads over processes are:

    1. Access to efficient synchronization objects without having to setup your own shared memory for them to live in.
    2. Atomicity of the process: it’s impossible for some threads to be terminated by factors beyond your control (like the user issuing a kill command) and others to live on. This is very important because in applications with complex synchronization requirements, unexpected asynchronous termination of one flow of execution (especially, for example, with a lock still held) could make it impossible for others to continue safely.
    3. The existence of threads is completely transparent to other parts of the program that don’t want/need to be aware of them (whereas creating child processes has global state issues with respect to waiting for exit status, SIGCHLD, etc.).

    In addition, threads have some other minor practical advantages:

    1. Faster creation/exit times (usually 2-3x faster than fork and at least 20x faster than fork+exec).
    2. Improved ability for the kernel to make scheduling fair between applications.
    3. (And probably some others I’m not thinking of…)

    And a few practical disadvantages:

    1. Unnecessary contention for locks in standard library functions like malloc.
    2. Ability of buggy code in one flow of execution to corrupt the state of others.
    3. Inability to have different privilege levels for each thread.

    The only time I would consider using separate processes instead of threads when the conceptual best-fit for the problem is threads is in cases where using separate processes provides a huge advantage to your security model (i.e. privilege separation ala vsftpd and openssh).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: c++ multithread I use c++ to implement a thread class. The code
Possible Duplicate: Making a log4j console appender use different colors for different threads I
Possible Duplicate: Could you explain STA and MTA? All ThreadPool threads are in the
Possible Duplicate: Handling exceptions from Java ExecutorService tasks I use the ExecutorService from Java
Possible Duplicate: Bind threads to processors In Linux, is it possible to fix threads
Possible Duplicate: Technically why is processes in Erlang more efficient than OS threads? Any
Possible Duplicate: Maximum number of threads per process in Linux? just with some curiosity
Possible Duplicate: How can one use multi threading in php applications Does PHP have
Possible Duplicate: Threads synchronization. How exactly lock makes access to memory 'correct'? This question
Possible duplicate question: Is there a way to indefinitely pause a thread? In my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.