{"id":20059571,"url":"https://github.com/monix/monix-forkjoin","last_synced_at":"2025-05-05T15:31:49.272Z","repository":{"id":57735887,"uuid":"77711380","full_name":"monix/monix-forkjoin","owner":"monix","description":"A port of the ForkJoinPool JSR-166 implementation used in Scala 2.11.x for usage in Scala 2.12","archived":false,"fork":false,"pushed_at":"2016-12-30T22:45:37.000Z","size":86,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-26T14:28:55.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-30T21:29:18.000Z","updated_at":"2024-03-26T14:28:55.851Z","dependencies_parsed_at":"2022-08-24T14:57:18.738Z","dependency_job_id":null,"html_url":"https://github.com/monix/monix-forkjoin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fmonix-forkjoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fmonix-forkjoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fmonix-forkjoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monix%2Fmonix-forkjoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monix","download_url":"https://codeload.github.com/monix/monix-forkjoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224452805,"owners_count":17313668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T13:08:25.024Z","updated_at":"2024-11-13T13:08:25.696Z","avatar_url":"https://github.com/monix.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# monix-forkjoin\n\nA port of the ForkJoinPool JSR-166 implementation used in Scala 2.11.x\nfor usage in Scala 2.12.\n\n## Rationale \n\nIn Scala 2.11.8 the `scala.concurrent.forkjoin.ForkJoinPool` implementation \nis a fork of the JSR-166 implementation by Doug Lea, in order to provide \nsupport for Java versions older than version 8. \nHowever in Scala 2.12.x the implementation is now an alias for \n`java.util.concurrent.ForkJoinPool`, given of its availability in \nJava 8 and the Scala 2.12 requirement to have Java 8 as a target. \n\nUnfortunately these 2 implementations are NOT the same, as the \nold Scala 2.11 implementation has better throughput in testing. \n\nThe version of `ForkJoinPool` in 2.11 uses busy-waiting more \naggressively which helps out in tests with more cores than \ntasks. However, this comes at the expense of other workloads on \nthe process/machine, especially because the JVM does not let the \nbusy waiting signal its intention to the CPU with a Spin Loop hint. \nThis trade-off was found during testing of the `ForkJoinPool` as it was \nintegrated into parallel `java.util.stream` and is discussed in JDK-8080623.\n\nBut in testing this implementation can have considerable better \nthroughput and can prove useful for heavy CPU-bound tasks and\nthe performance hit for some use-cases is quite noticeable.\n\n## Usage\n\nAvailable for Scala 2.10, 2.11 and 2.12.\nAdd the dependency in your SBT file:\n\n```scala\nlibraryDependencies += \"io.monix\" %% \"monix-forkjoin\" % \"1.0\" \n```\n\nAnd then:\n\n```scala\nimport monix.forkJoin.ForkJoinExecutionContext\n\nimplicit val executionContext = \n  ForkJoinExecutionContext.createDynamic(\n    parallelism = Runtime.getRuntime.availableProcessors(),\n    maxThreads = 256,\n    name = \"forkJoin-dynamic\",\n    daemonic = true\n  )\n```\n\n## License\n\nThe `monix-forkjoin` project is licensed under the 3-Clause BSD license,\nthe same license as Scala, see `LICENSE.txt` for details. \n\nThe `ForkJoinPool` implementation is copied from the Scala 2.11 repository, \nwhich itself was copied from Doug Lea's JSR-166 implementation and is under the \n[public domain](http://creativecommons.org/publicdomain/zero/1.0/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonix%2Fmonix-forkjoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonix%2Fmonix-forkjoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonix%2Fmonix-forkjoin/lists"}