[omniORB] Some comments regarding omniThread
Bruce Visscher
bvisscher@mindspring.com
Mon, 13 Jul 1998 20:46:16 -0400
I hate to reply to my own post but:
Bruce Visscher wrote:
>
> 1. I just recently discovered that omni_mutex and omni_mutex_lock have
> compiler generated copy constructors and copy assignment operators. I
> normally expect to see these declared private and not implemented to
> prevent them from being copied.
>
> 2. I think it would be useful to have protected access to the omni_mutex
> implementation. I have recently had some problems porting NT code that
> uses omni_mutex to VMS. The problem is that on NT an omni_mutex is
> recursive. On VMS (DECthreads) it is not. The result is that the
> application deadlocks on VMS. It would be useful to be able to derive
> from omni_mutex for the purpose of initializing the mutex with a
> recursive attribute (I realize this would not be portable to other POSIX
> implementations...alas, the only portable attribute seems to be the
> default one).
>
> 3. I think the ReadersWritersLock classes (in src/appl/omniNames)
> implement a useful abstraction. Should these be made part of
> omniThread?
I forgot another one:
4. Several of the mutex related classes throw exceptions in their
destructors. IMHO, destructors should never throw. In particular, it
makes it difficult to implement a graceful shutdown of the application.
I will admit that the only time that I've encountered these destructors
throwing has been when there has been another problem (which manifests
itself via a mutex being destroyed with a lock still active). However,
I think it would be better if the destructor simply reported the problem
and returned normally.
Comments?
Bruce