Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Java 8 Streams and Eratosthenes
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Sebastian, post: 5098785"] Am 12.06.2013 01:17, schrieb Stefan Ram: Brian Goetz gives concurrency issues as the reason in his "official" State of the lambda, section 7: "It is our intent to prohibit capture of mutable local variables. The reason is that idioms like this: int sum = 0; list.forEach(e -> { sum += e.size(); }); are fundamentally serial; it is quite difficult to write lambda bodies like this that do not have race conditions. Unless we are willing to enforce—preferably at compile time—that such a function cannot escape its capturing thread, this feature may well cause more trouble than it solves." [URL]http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Java 8 Streams and Eratosthenes
Top