@cdunn2001, Thread[] variable was not reusable until
[https://github.com/nim-lang/Nim/pull/5585](https://github.com/nim-lang/Nim/pull/5585).
So, to run your code and see expected results, please update your Nim to
current devel version.
The code doesn't hang for me (either on macOS or Linux), and I can't
immediately see why it would from looking at the code in `system/threads.nim`.
Reusing a thread that is still running would obviously be a recipe for
disaster, but that does not seem to be happening.
> I haven't been able to cause fragmentation
Are you sure that
var x = newStringOfCap(10*(11-i))
is really contained in the executable? Well maybe with -O0, but maybe Nim
compiler already removes it?
Interesting. I got it working by moving `newSeq(threads, 4)` into `cycle()`. I
guess once a thread has finished running, simply releasing the `Thread[]`
object to GC is the way to destroy it. They are apparently not re-usable.
I haven't been able to cause fragmentation after thread destruction,
I am trying to test memory fragmentation after thread destruction, but I don't
know how to destroy threads properly. What is wrong with this program?
import os
var threads: seq[Thread[int]]
proc wait(s: int) =
for i in 0..10:
var x = newStringOfCap(10
> Is it possible to return value from template which the last of argument is
> untyped?
pretty sure you can:
[https://nim-lang.org/docs/manual.html#templates](https://nim-lang.org/docs/manual.html#templates)
Yeah, that looks wrong, I guess I was just playing around.
@araq:
> and after the thread dies, everything is freed.
That's really the problem. I am using `threadpool`, which creates 48 threads
when the program starts. Limiting the number of threads seems to cause some to
die after usage, but I don't understand what that code is doing. Are you
suggesti
@def, I'm curious about your example here:
[https://github.com/def-/nim-unsorted/blob/master/wcl.nim](https://github.com/def-/nim-unsorted/blob/master/wcl.nim)
When you cast to `string` with
var
size = 4096
buf = cast[ptr string](alloc0(size))
Doesn't a `string` h
I mean I also have my project in that direction:
[https://github.com/krux02/opengl-sandbox](https://github.com/krux02/opengl-sandbox)
But I think we have different goals in mind. I try to provide a toolset that
allows to write arbitrary custom rendering pipelines quickly for arbitrary
data. In
Thank you for clarification.
We're certainly not trying to start any wars with anyone, however FRAG does
offer some features Nimgame2 does not, with the added cost of complexity.
If you have any questions - until we get our own website going - please feel
free to ask here or in the project's gitter.
Thank you for checking
12 matches
Mail list logo