Does every thread have its main function?

Does every thread have its own main function?

I know that its have its own stack, but what about main function (not necessarily a function which called main).

For example, when creating a thread, we pass a function as an argument for the new thread to run it.

• Can you define "main function"? – harold Jul 27 '20 at 18:54
• @harold A function which the thread executes. Just like that the first thread of a program runs the main method (the "actual" main) – Dani Jul 27 '20 at 19:03
• A thread has an entry point, but whether that qualifies as a "main function" depends on your definition and it is still vague. It's also not clear what you mean by "its own". – harold Jul 27 '20 at 19:17

However the entry point of a thread does not have to be at some dedicated function, or even at the start of a function. As a counterexample I would invite you to look at POSIX fork().
• Isn't fork used for creating a new process (not a new thread)? – Dani Jul 27 '20 at 19:51