Are threads bad? - was: Future of Pypy?

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


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

> Paul Rubin <no.email at nospam.invalid>:
>
> > Marko Rauhamaa <marko at pacujo.net> writes:
> >> So why lock categorically like that? Java has a handy "synchronized"
> >> keyword that wraps the whole method in "with self.lock". ...
> >> Unfortunately, that deep locking analysis *is* required at every turn,
> >> and mistakes *are* bound to happen.
> >
> > I wonder if synchronized was a mistake in Java. It confused me a lot
> > when I tried to use it, but I never had to mess with it that much. I
> > can't quite tell what your code is doing (why is it attempting a
> > socket read with a lock held) and I'd be interested to see what an STM
> > version would look like.
>
> Synchronized methods are actually quite a powerful idea, but a bit
> underappreciated by many Java developers.
>
>
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.


>
>
> 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/3f226562/attachment.html>


More information about the Python-list mailing list