What is the difference between a process and a thread?

后端 未结 30 2181
Happy的楠姐
Happy的楠姐 2020-11-22 00:39

What is the technical difference between a process and a thread?

I get the feeling a word like \'process\' is overused and there are also hardware and software threa

30条回答
  •  难免孤独
    2020-11-22 01:05

    The following is what I got from one of the articles on The Code Project. I guess it explains everything needed clearly.

    A thread is another mechanism for splitting the workload into separate execution streams. A thread is lighter weight than a process. This means, it offers less flexibility than a full blown process, but can be initiated faster because there is less for the Operating System to set up. When a program consists of two or more threads, all the threads share a single memory space. Processes are given separate address spaces. all the threads share a single heap. But each thread is given its own stack.

提交回复
热议问题