Nim threads vs Pthreads

2017-01-04 Thread sheosi
So I'm working with threads, and I've found the Nim threads to be somewhat 
limitating. Now, I'm wondering what differences are between those two? My main 
question is: do I get the GC for posix threads too, or I need to set up it by 
myself?


Re: Variables alignment

2016-08-29 Thread sheosi
I'm new to this so I don't know much, but if I'd to say I'd guess that one 
reason might be performance and memory.

Gcc and clang have the "aligned" attribute and in his C atomics library Jeff 
Preshing was using that (together with volatile). So there must be cases where 
it does not align.


Re: Variables alignment

2016-08-28 Thread sheosi
Krux02, from what I've read about lockfree (namely Jeff Preshing's blog: 
[http://preshing.com](http://forum.nim-lang.org///preshing.com)/ ), one 
requirement for atomics in x86 (and other architectures) are aligned variables. 
And about the types anything from 1 to four bytes.

Araq,I have already tried that, my problem is that I can't use it inside 
objects nor tuples, and while I've yet to try I think I can't use it on 
typedefs neither. I know MSVC always align,but how do I know gcc/clang may 
align them, from what I've tested gcc aligns global variables. 


Variables alignment

2016-08-27 Thread sheosi
Probably this has been answered before, but how I make variables aligned in 
Nim? I need that because for lockfree programming one of the requirements for 
atomic operations is that is aligned in memory. How can I do that?