[uClinux-dev] Threading and synchronization questions

Jan Ringoš tringi at mx-3.cz
Fri Feb 27 20:18:10 EST 2009


From: "Lennart Sorensen" <lsorense at csclub.uwaterloo.ca>
> On Fri, Feb 27, 2009 at 05:57:28AM +0100, Jan Ringo? wrote:
>> Well, I am interested in uClinux only, in this case. I still don't see
>> the difference. If all the processes live in the same address space here,
>> and when I create a thread (pthread_create) I see a new duplicate process
>> through ps command (just as if created by vfork), then what can it be,
>> that would make pthread_mutex not work?
>
> So if you want to write good software, you will pretend that each process
> has its own memory space and make sure you never try to read an address
> that your process doesn't own.  If you want to talk to another process,
> use a unix socket.  If you want everyone to poke at each others memory,
> why not just build one single giant executable with threads since at
> least then it is obvious to anyone that looks at the code that that is
> in fact what you are doing.

Poking at each others memory is not the exactly what I wanted to do :)

Anyway, I am interested in using processes instead of threads, because then 
I would be able to, for specific application of the device, include only 
neccessary executables. I don't like the idea of having one large program 
where many functions may not even be used, and where a crash of one thread 
tears down everything.

---
Jan Ringoš, jan at ringos.cz
www.ringos.cz, tringi.mx-3.cz




More information about the uClinux-dev mailing list