[DB-SIG] DB API 1.1 Spec

M.-A. Lemburg mal@lemburg.com
Fri, 12 Mar 1999 10:43:56 +0100

Greg Stein wrote:
> M.-A. Lemburg wrote:
> > Andy Dustman wrote:
> > >...
> > > And perhaps the point needs to be made that "share" means "two threads
> > > using the same resource without a mutex". With a mutex, and the right user
> > > locking code, anything ought to be shareable.
> >
> > Hmm, not sure about that one: the mutex could not be coarse grained
> > enough to lock out potential problems ;-) Anyway, I'll add a note
> > about the code "being thread safe all by itself".
> Even with a mutex, the MSFT SQL Server connector cannot be used from a
> different thread. If a thread creates a connection, then that is the
> only thread that can use it.
> So: the doc shouldn't simply say that a mutex can solve the threading
> issues. It could/should reflect one of three possibilities: fully thread
> safe, usuable across threads with a mutex, not usable across threads.

I added a note about this to the spec:

	      Sharing in the above context means that two threads may
	      use a resource without wrapping it using a mutex
	      semaphore to implement resource locking. Note that you
	      cannot always make external resources thread safe by
	      managing access using a mutex: the resource may rely on
	      global variables or other external sources that are
	      beyond your control.

Is this ok with both of you ?

As always the updated copy is at:


Marc-Andre Lemburg                               Y2000: 294 days left
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :