Thanks. - vishal > -----Original Message----- > Sent: Friday, June 19, 2009 3:15 PM > To: [email protected] > Subject: Python-list Digest, Vol 69, Issue 214 > > Message: 6 > Date: Fri, 19 Jun 2009 10:53:27 +0200 > From: Piet van Oostrum <[email protected]> > To: [email protected] > Subject: Re: Help: Group based synchronize decorator > Message-ID: <[email protected]> > Content-Type: text/plain; charset=us-ascii > > >>>>> Vishal Shetye (VS) wrote: > > >VS> I want to synchronize calls using rw locks per 'group' and my > implementation is similar to > >VS> http://code.activestate.com/recipes/465057/ > >VS> except that I have my own Lock implementation. > > >VS> All my synchronized functions take 'whatGroup' as param. My lock > considers 'group' while deciding on granting locks through acquire. > > >VS> What I could come up with is: > >VS> - decorator knows(assumes) first param to decorated functions is > always 'whatGroup' > >VS> - decorator passes this 'whatGroup' argument to my lock which is used > in acquire logic. > > >VS> Is it ok to make such assumptions in decorator? > > As long as you make sure that all decorated functions indeed adhere to > that assumption there is nothing wrong with it. > -- > Piet van Oostrum <[email protected]> > URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] > Private email: [email protected]
DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails. -- http://mail.python.org/mailman/listinfo/python-list
