[ELDK] glibc change for eldk 3.1.1
Detlev Zundel
dzu at denx.de
Fri Mar 26 14:57:15 CET 2010
Talking to myself:
>> BerkeleyDB source code has a comment like this :
>>
>> "Currently we support one kind of mutex that is intra-process only,
>> POSIX 1003.1 pthreads, because a variety of systems don't support
>> the full pthreads API, and our only alternative is test-and-set."
>>
>> So I thought there is something in the standart like inter process mutex.
>
> Weird. Again I looked at the mag page of "pthread_mutex_init" and I do
> not see how one could use this to get to a mutex from another process.
> The _only_ way I can think of is to initialize a mutex and then do a
> fork() afterwards. This way one would get multiple processes sharing
> the address space. However one fork documentation[1] says this:
>
> When a programmer is writing a multi-threaded program, the first
> described use of fork(), creating new threads in the same program, is
> provided by the pthread_create() function. The fork() function is thus
> used only to run new programs, and the effects of calling functions
> that require certain resources between the call to fork() and the call
> to an exec function are undefined.
>
> So I doubt that this is legal use of pthread_mutexes.
[1] http://www.opengroup.org/onlinepubs/009695399/functions/fork.html
Cheers
Detlev
--
Those who do not understand Unix are condemned to reinvent it,
poorly.
- Henry Spencer, University of Toronto Unix hack
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the eldk
mailing list