The simple answer is that can't share a thread. Your question, as phrased, doesn't make much sense.
You can share things between one or more threads. These things can include individual variables, whole data structures, filehandles, pipes etc.
Some flavours of threads, in some languages and or some operating systems may allow (or deny) any or all of these things.
Before anyone can point you at an example of using threads, you will have to ask a much clearer question, and that probably means that you will need to get a much clearer idea of what threads are, and what it is that you want to do with them.
Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.
| [reply] |
Assignments are set for a reason, they're for learning purposes
and this includes research....</homeworkJoke>
How exactly do you want to share a thread ? share variables
between them ? connect them together with a FIFO type queue ? Try threads::shared or threads::shared::queue.
I can't believe it's not psellchecked
| [reply] |