Omnithread
Brian Burton
brian.burton@burton-computer.com
Wed, 28 May 1997 08:38:37 -0400
Tristan Richardson wrote:
>
> >
> > I'm porting the omnithread library to BeOS (http://www.be.com) and
> > noticied that there are no classes in the omnithread.h file for
> > acquiring and releasing mutexes and semaphores. These really should be
> > added since they would be far more convenient and less error prone than
> > calling lock()/unlock() directly.
> >
>
> You're right that classes like these would be useful. The reason they're not
> included is simply that the omnithread library was one of the first pieces of
> C++ code I ever wrote (this was several years ago!). If you look at the
> omniNames source in "ReadersWritersLock.h" you'll see I use the same trick
> that you suggest.
>
It is amazing how much the language has changed in just a few years! I
like the omnithread classes. They offer a small set of very useful
features rather than trying to be the ultimate threads library. I'd
just like to give them a bit more polish.
>
> Again this is because omnithread was written quite a while ago, before
> exceptions were commonplace, and we wanted it to be as widely portable as
> possible. However, given that omniORB2 requires that the C++ compiler
> supports exceptions it would indeed improve the omnithread interface to make
> use of this fact.
>
> We will almost certainly add these features in the next release of omniORB2.
> However, we must of course be careful about changing fundamental APIs like
> this which may potentially break existing code.
>
Yes. It may be wise to keep the old classes unchanged and replace them
with a more modern set of classes. Then old code could continue to
function normally while new code could use the new classes. If the
interfaces of the new classes are very similar tol those of the old
(same signatures except for return types plus exceptions) then
converting to the new classes could be fairly simple.
All the best,
++Brian
--
Brian Burton Custom Software Development
Burton Computer Corporation Java, C++, Orbix, Tuxedo
brian.burton@burton-computer.com OO Consulting and Mentoring