Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] createThread is not GC-safe #14370

Closed
mratsim opened this issue May 16, 2020 · 0 comments
Closed

[Regression] createThread is not GC-safe #14370

mratsim opened this issue May 16, 2020 · 0 comments

Comments

@mratsim
Copy link
Collaborator

mratsim commented May 16, 2020

The following compiles in Nim 1.2.0 but fails on latest devel

proc display() {.gcsafe.} =
  echo "Echo from thread ", getThreadId()

proc displayManager() {.gcsafe.} =
  var t: Thread[void]
  t.createThread(display)

proc main() {.gcsafe.} =
  var displayService: Thread[void]
  displayService.createThread(displayManager)

main()

Error:

Error: 'displayManager' is not GC-safe as it calls 'createThread'
Araq added a commit that referenced this issue May 16, 2020
@Araq Araq closed this as completed in 7f377da May 16, 2020
mratsim added a commit to mratsim/weave that referenced this issue May 16, 2020
* Create base types for composability with other execution engines #132

* Renamings

* Prepare for job support

* Weave as an executor service - high-level API

* Update the state machine to support executor mode

* Wait for the runtime to be ready (next step, wakeup of worker tree on submission)

* Have a manager thread handle job submissions to avoid race in termination detection

* Fix parallel jobs example to properly wait

* add job spawning tasks test

* Fix awaiting delayed computations

* Implement jobs with multiple dependencies

* add runInBackground to start Weave as a service

* Update tests and documentation

* Workaround upstream regression on GC-safe createThread nim-lang/Nim#14370

* cleanup can have side effect on Windows. Also bmp nimble version

* cleanup for LazyFlowvar can also have side-effects

* Threads cannot be copied ¯\\\_(ツ)\_/¯
EchoPouet pushed a commit to EchoPouet/Nim that referenced this issue Jun 13, 2020
mratsim added a commit to mratsim/weave that referenced this issue Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant