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

Strange -only --gc:none is stable #3

Open
KMiNT21 opened this issue Jan 19, 2019 · 1 comment
Open

Strange -only --gc:none is stable #3

KMiNT21 opened this issue Jan 19, 2019 · 1 comment

Comments

@KMiNT21
Copy link

KMiNT21 commented Jan 19, 2019

I'm not sure if it lib or Nim or I do something wrong, but after many hours I can't find the place...

I simplified my code ~ to this TEST example.
So it runs 250 tasks and from time to time crashed with:
Error: execution of an external program failed: (path)
It stops before line "echo "Finished.""

If I use --gc:none - it works stable every start.
But I can't understand where can be problem with GC ...

...
let files_dir = "some-folder-with-txt-files"
let files_to_process = lc[f | (f <- walkFiles(files_dir & "/*.txt")), string]
...
const my_limit = 250
...
let my_files = files_to_process[0..my_limit-1]

proc process(ch: MsgBox[int], file_path: string) {.routine.} =
    let data = readFile(file_path)
    let s = len(data.splitlines())

echo "Starting.."

for i in 0..my_limit-1:
  pRun process, (boxes[i], my_files[i])
waitAllRoutine()

echo "Finished."

nim c -w:off --hints:off --verbosity:0 --threads:on -r rtest.nim

If I remove waitAllRoutine() - no errors, but if I put sleep(5000) instead to give time for threads - ERROR back again some times. So problem somewhere it threads switching.

@rogercloud
Copy link
Owner

rogercloud commented Jan 21, 2019

Sorry, this lib is not maintained to catch NIM's latest changes for years. It's quite a surprise to know that people are still using it. Thank you for the trust.

I'm not sure I have bandwidth to fix it in time. Do you mind to put this case in the test dir and help debug the lib? :) A PR is quite welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants