One reason Java incorporates multi-threading into its platform is to avoid the detail and incompatibilities of thread systems on different OS platforms.
Any example will therefore be specific to an operating system or a family of closely related ones.
That said, in C/C++ they're written the same way. A C/C++ thread points to a starter function which in turns has all the code. One or more flag values are used to indicate certain behavior for the thread (priority, service or utility thread, etc.).
Here's an pseudo-example stolen from
this book. It uses threading to load images from files into memory:
Not hard to see why people like what Java promises: a cleaner way to get to a complex but powerful programming technique. With a little thought, I could probably write the
complete example in Java in fewer lines, and compile it on the first or second go.