Re: [Python-ideas] [Value Returning Threard]

Please provide more explanation for why the currently available features are insufficient. Note that what you're asking for would change the semantics of Python at a very deep level and will almost certainly be rejected in its present form. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
I'm no python expert but i had to do a stress test on a libary. (checking thread safety) here is the code (we soe absraction): def testMultiThread(): global resultDict resultDict = {} def testFuncThread(func): global resultDict if func(): resultDict[func] = 'Passed' else: resultDict[func] = 'Falied' thread.start_new(testFuncThread,(Test1,)) thread.start_new(testFuncThread,(Test2,)) thread.start_new(testFuncThread,(Test3,)) while (len(resultDict) < 3): time.sleep(5) return resultDict #here i did something else such as logging and returning True or False Maybe there is a better way for doing this? If we had something like i suggested (with .value or not) def testMultiThread(): resultDict = {} resultDict[Test1]= thread.startValueReturningThread(Test1) resultDict[Test1]= thread.startValueReturningThread(Test2) resultDict[Test1]= thread.startValueReturningThread(Test3) return resultDict #or again, pharsing the result...

On Thu, May 07, 2009, yoav glazner wrote:
I'm no python expert but i had to do a stress test on a libary. [...] Maybe there is a better way for doing this?
For questions about using Python, please post to comp.lang.python -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ "It is easier to optimize correct code than to correct optimized code." --Bill Harlan
participants (2)
-
Aahz
-
yoav glazner