ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> db-sig
db-sig
Re: [DB-SIG] DB API 1.1 Spec
by M.-A. Lemburg other posts by this author
Mar 12 1999 7:43PM messages near this date
Re: [DB-SIG] DB API 1.1 Spec | Re: [DB-SIG] DB API 1.1 Spec
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:

	http://starship.skyport.net/~lemburg/DatabaseAPI-1.1.html

-- 
Marc-Andre Lemburg                               Y2000: 294 days left
---------------------------------------------------------------------
          : Python Pages > >> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------
Thread:
M.-A. Lemburg
M.-A. Lemburg
M.-A. Lemburg
Greg Stein
Stephen J. Turner
Andy Dustman
M.-A. Lemburg
M.-A. Lemburg
Greg Stein

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved