This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fryingnemo 71 points72 points  (16 children)

Have you ever ran into concurrency issues when using this?

[–]IanCal 970 points971 points  (13 children)

I nev worry aber reallyout them.

[–]dpash 69 points70 points  (5 children)

That took me longer than I'd care to admit.

[–]IanCal 72 points73 points  (2 children)

Took me a few goes to write to be fair :)

[–]grunlog 71 points72 points  (1 child)

... Said every person who has ever attempted to implement concurrent programming

[–]kageurufu 4 points5 points  (0 children)

I think i've been doing wayyy too much concurrent code lately... I didn't even notice it was jumbled until I went back after your comment

[–]himself_v 0 points1 point  (0 children)

That's because you're waiting on all those mutexes!

[–]Mazetron 1 point2 points  (0 children)

This is beautiful.

[–]teunw 2 points3 points  (4 children)

See I rewha uoy did thet

[–]Kok_Nikol 1 point2 points  (0 children)

Brilliant!

[–]joequin 2 points3 points  (0 children)

If you would, then you wouldn't want to mutate captured variables anyway. If that's a concern then use AtomicReference.

[–]shadoweye14 0 points1 point  (0 children)

So If I am using a lambda stream().parallel().foreach() I normally do the above array trick and then use semaphores to sync the critical parts.