[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Context parameter in public API

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-10-13 20:00:37 CEST

Karl Fogel wrote:

>"Bill Tutt" <rassilon@lyra.org> writes:
>
>
>>>Or, instead of a context baton, should we just have a global
>>>Configuration object? (Please, no reflexive "globals are evil"
>>>responses. If this particular use of a global object is evil, say
>>>exactly why.)
>>>
>>>
>>The general answer to as to why globals are evil ends up revolving
>>around thread safety.
>>
>>
>
>Right, but in this case we'd initialize a global data structure at
>startup time, based on the data in ~/.subversion/*, and then never
>modify that structure afterwards.
>
>So is thread-safety really an issue here?
>
>

Who says it'd be a global constant? The config file implementation, for
instance, uses an APR has table to store the config data. APR doesn't
say anything about the thread-safety of lookups in that table.

Besides, there's another issue -- sooner or later, we'll want to support
multithreaded clients. If we introduce a global, the client's threads
will have to serialize on Subversion API calls. That's not acceptable.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 13 20:01:14 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.