Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > static statements and thread safety

Reply
Thread Tools

static statements and thread safety

 
 
Eric Snow
Guest
Posts: n/a
 
      09-22-2011
A recent thread on the python-ideas list got me thinking about the
possibility of a static statement (akin to global and nonlocal). I am
wondering if an implementation would have to address thread safety
concerns.

I would expect that static variables would work pretty much the same
way as default arguments, with a list of names on the code object and
a list of values on the function object. And I would guess that the
values from the static variables would get updated on the function
object at the end of the call. If multiple threads are executing the
function at the same time won't there be a problem with that
end-of-call update?

-eric


p.s. It probably shows that I haven't done a lot of thread-related
programming, so perhaps this is not a hard question.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statements and case statements questions John Crichton Ruby 6 07-12-2010 06:17 PM
Thread safety problems with function scope static variables vs class static private members Hicham Mouline C++ 5 12-19-2008 08:10 PM
Thread safety and static member functions Olumide C++ 6 10-23-2007 12:41 AM
Static allocation in a static function & thread safety paolo.brandoli@gmail.com C++ 5 08-23-2007 09:48 PM
Static Functions and Thread Safety. How does it work? =?Utf-8?B?V2ViTWF0cml4?= ASP .Net 6 03-24-2006 09:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57