yep. but you could also just return the results from your worker-thread and use 
the mainthread to collect it instead of pushing the result into the history. As 
mentioned by yglukhov each thread owns his own gc and all objects which are 
spawned by the thread are owned by it's gc. so never cast a pointer to a ref 
unless the object belongs to it's context(thread). If you like to go without 
locks use atomics. you could also read this discussion 
forum.nim-lang.org/t/3896 or you may look at my implementation 
[https://github.com/mikra01/timerpool](https://github.com/mikra01/timerpool) . 
Or use channels. Once you have got it, it's easy...

Reply via email to