This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Nested calls to Mutexes


>From: Andrew Lunn <andrew.lunn@ascom.ch>
>To: eCos Disuss <ecos-discuss@sourceware.cygnus.com>
>Subject: Re: [ECOS] Nested calls to Mutexes
>Date: Wed, 21 Mar 2001 14:59:08 +0100
>To me this is dangerous. Mutex's are used to protect state
>information. I lock the mutex when im want to modify the state
>information. The locked mutex indicates the state information may not
>be consitent.

I am NOT going to argue with you. I believe that implementations
such as WIN32, OS/2, pSOS, RTEMS and many other OS provides have
a better semantic that the one that eCOs provides.

As long as the mutexes primitives guarantee that the mutex
still owned by the calling thread until all acquire()/release()
balance, I fail to see how this is dangerous.

If you plan to write code that must run on many platforms,
or at least you plan test a *fair amount* of your code on
platforms such as Lunix/Windows, it is nice to have the
mutex with the same behavior ( semantic ) of all OS's.
eCOs does not provide that for me, and I have to that
semantic to my code myself, possibly introducing errors.

Look at the behavior of the "synchronized" keyword of
java. It allows nested calls. There is no dangerous
doing this.

Show me a case where this behavior is dangerous ?

Rosimildo.








_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]