brooksmoses: (Default)
[personal profile] brooksmoses
I just wrote my very first multithreaded program using pthreads. A very simple "Hello World" that creates a short array of thread numbers, and then creates a thread for each element in that array; each thread then loads its respective number from the array and prints out, "Hello, I am thread %d!"

Shortly thereafter, I debugged my first race condition in a multithreaded program.

I suppose this is the way of things, then?

Date: 2008-04-29 09:59 am (UTC)
From: [identity profile] elisteran.livejournal.com
If you're going to be using shared memory, perhaps you can do it in terms of shared mmap regions and separate processes instead? One of the things about pthreads is how easy it is for separate threads to be modifying shared state.
Page generated Jan. 20th, 2026 07:27 pm
Powered by Dreamwidth Studios