Where to read about threading and data sharing in Nim 2

2023-08-14 Thread Araq
malebolgia makes it safe. But I'm thinking of an abstraction that is less ugly.

Where to read about threading and data sharing in Nim 2

2023-08-14 Thread c4UlMu
I haven't heard of `malebolgia`. I'll read about it. It's is unfortunate that we still have to use `ptr` in `addr` because it can be dangerous

Where to read about threading and data sharing in Nim 2

2023-08-14 Thread c4UlMu
This is very useful example because now I understand how to use Isolated (at least I think I understand) Very useful `template withMyLock`

Where to read about threading and data sharing in Nim 2

2023-08-13 Thread Araq
Here is a more interesting program: import std / [strutils, tables] import malebolgia import malebolgia / ticketlocks proc countWords(filename: string; results: ptr CountTable[string]; L: ptr TicketLock) = for w in splitWhitespace(readFile(filename)): w

Where to read about threading and data sharing in Nim 2

2023-08-13 Thread Araq
Here is an example showing list handling via Isolated[T]: import std / [os, locks, atomics, isolation] type MyList {.acyclic.} = ref object data: string next: Isolated[MyList] template withMyLock*(a: Lock, body: untyped) = acquire(a)

Where to read about threading and data sharing in Nim 2

2023-08-13 Thread c4UlMu
I wanted to ask if are there any articles about threading in Nim 2 In particular, I am interested in data sharing between threads Can I move data between threads without copying it? I remember there was some Isolated stuff, but it was in development And some stuff about SharedPtr. Are there any