Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!xavax!jat From: jat@xavax.com (John Tamplin) Newsgroups: comp.lang.c++ Subject: Re: Pre and Post actions - an idea. Message-ID: <1990May4.195250.9662@xavax.com> Date: 4 May 90 19:52:50 GMT Organization: Xavax Lines: 34 In article <263BF5E3.16516@paris.ics.uci.edu> rfg@paris.ics.uci.edu (Ronald Guilmette) writes: ... >Note that in the class `foo' shown above, the member function member_2 is >preceded by a new keyword, i.e. "exempt". In the scheme proposed here, a >call to a member function declared as "exempt" would cause the normal >(implicit) pre and/or post member function invocations to be suppressed >for that member function only. > >The syntactic & semantic rules for the "exempt" keyword, would be virtually >the same as for the "virtual" keyword, except that it should be allowable for >constructors to be declared as "exempt". (Note that destructors can be >virtual, and they should also be allowed to be "exempt".) The problem with this is that there is no way to implement something like the normal readers/writers solution: n readers with no writers or 1 writer with no readers. To do that you need to know which member function is being called, and for other solutions you might even need to know the arguments. It is simple to put a call to lock() and unlock() around the body of a member function in the simple case and for more complicated cases you need special code for each member function anyway. I have not seen the Capsule stuff myself, but from the short except given before I would agree that it adds too much fluff for not enough functionality. The par section appears to provide enough functionality for readers and writers, but I don't see a clean way to extend the syntax to more difficult problems. Another problem is you don't get to specify whether you want gated service, prioritized service, or what kind of fairness guarantees you want. I myself prefer to just use standard C++ and insert "mutex.P()" and "mutex.V()" around my member functions. When I want more sophisticated concurrency control, I write it myself. -- John Tamplin Xavax jat@xavax.COM 2804 S Memorial Parkway ...!uunet!xavax!jat Huntsville, AL 35801