Kannan K
Kannan K

Reputation: 97

Can a thread exist outside of a process?

In other words, is it possible to have thread without a process. I think it's not possible to have thread without a process. A process at least has a main thread.

Upvotes: 2

Views: 912

Answers (1)

Solomon Slow
Solomon Slow

Reputation: 27210

Threads run code. So essentially, you are asking whether it is possible to run code without a process.

The answer depends on where you want the code to run.

There are kernel-mode threads that run in the Linux operating system that are not associated with any particular process, and there are bare-metal embedded systems that have threads, but which have no notion of "process."

If you want a thread running user-mode code in some desktop, server, or mobile OS though, and you don't want it to be associated with any process; then that's probably not going to happen.

Upvotes: 6

Related Questions