|
|
|
|
|
by st3fan
5999 days ago
|
|
"""Does it work? Yes it's better: Sequential 23.5 seconds. Threaded 24.0 seconds.""" How is that better? It is an improvement over earlier versions of Python. Better would be if the threaded version would actually be twice as fast. |
|
Therefore, the expected behavior of running these two threads would be to have identical runtimes. That would be the "perfect" case with a GIL. So with this "better" GIL its actually near-perfect in this _simple_ case. (Like the presenter said, there needs to be more tests to study the behavior under heavier tasks)
What you're describing, with the threaded being "twice as fast" assumes that the threads will allow two python-instruction-bound tasks to run concurrently, which would require having no GIL.