Are threads bad? - was: Future of Pypy?

Marcos Almeida Azevedo marcos.al.azevedo at gmail.com
Wed Feb 25 00:58:02 EST 2015


On Wed, Feb 25, 2015 at 1:46 PM, Marko Rauhamaa <marko at pacujo.net> wrote:

> Marcos Almeida Azevedo <marcos.al.azevedo at gmail.com>:
>
> > Synchronized methods in Java really makes programming life simpler.
> > But I think it is standard practice to avoid this if there is a
> > lighter alternative as synchronized methods are slow. Worse case I
> > used double checked locking.
>
> I have yet to see code whose performance suffers from too much locking.
> However, I have seen plenty of code that suffers from anomalies caused
> by incorrect locking.
>
>
>
Of course code with locking is slower than one without. The locking
mechanism itself is the overhead.  So use it only when necessary.  There is
a reason why double checked locking was invented by clever programmers.



> Marko
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Marcos | I love PHP, Linux, and Java
<http://javadevnotes.com/java-integer-to-string-examples>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150225/8cc9b077/attachment.html>


More information about the Python-list mailing list