Saucy Goat
Saucy Goat

Reputation: 1675

Maintain pthread after executing

Is it possible to have a POSIX thread remain "alive" after executing the function given as an argument? As in reusing that thread for further work.

For example, given a queue of functions to execute, is it possible to have a pthread execute several of them? The alternative would be creating a pthread for every task.

Upvotes: 2

Views: 56

Answers (1)

gsamaras
gsamaras

Reputation: 73366

No.

What you describe reminds me of a thread pool, where a set of threads is waiting for work (your functions in this case) to execute.

Upvotes: 3

Related Questions