Hi, I discovered nim 2 months ago, and it's certainly exciting: the efficiency
/ readability combination is extremely promising! But... I translated java ->
nim a (chess engine) program. Hoping to get a better executable regarding
memory consumption and speed.
Up to now, my single-threaded version works correctly and with excellent
results. Next step is multi-threading design ... Going through the nim
documentation (threads, spawn, locks, threadpools) leaves me in a perplex mood.
Question : **Is it possible to multi-thread the engine with the following
requirements?** :
Data structure
* Nodes and Links as structured objects. A Node contains seq[Links] - and
other fields. A Link contains 2 Node references - and other fields.
* All nodes are stored in a large Table var (~10e6 ... 10e8 entries)
* Some threads should create new Nodes and Links, ans put the Nodes in the
Table (>10e5 per seconds)
* Other specialized threads should update the 'other fields' of the Nodes.
* One thread should eliminate unneeded Nodes and Links.
Exploring the nim thread doc (" _Each thread has its own (garbage collected)
heap and sharing of memory is restricted to global variables._ "), I am rather
discouraged. Would it be some nim way to achieve these goals ?
Tnx for any help, and congratulations for the nim achievements anyway !
Fil