Commit Graph

19 Commits

Author SHA1 Message Date
Michael Bradley 3305e41f9d
Merge pull request #1 from emizzle/refactor/thread-safe-4
feat: make edn.nim threadsafe
2021-03-17 07:32:30 -05:00
Eric Mastro 923ab0207a
feat: make edn.nim threadsafe
Mark all forward declarations as `{.gcsafe.}` to ensure the compiler checks the proc bodies for gc-safeness.

All global variables are now marked as `{.threadvar.}` to ensure they are thread-local, the values of which are not copied during thread creation, thus requiring the remaining changes.

When a new thread is created, the thread-local (`{.threadvar.}`) vars are not intialised and the global proc calls are not called, which, in our case was just `init_edn_readers()`. To workaround this, another variable, `initialised`, was created to keep track of whether or not the initialisation had occured. It will have occurred in the main thread, but would not have occured subsequently created threads. Every time `read` is called, we check if initialisation hasn’t yet happened, in which case we initialise it. Very similar to a singleton pattern.
2021-03-17 17:05:14 +11:00
Roland Sadowski 434a31afc0 ParseError inhersit CatchableError 2020-12-23 14:47:06 +00:00
Roland Sadowski 7a00f7b1c0 remove parseutils import - not used 2020-12-23 14:42:37 +00:00
Roland Sadowski 1dbe5f2722 add nim package to build file 2020-12-23 14:38:46 +00:00
Roland Sadowski 5e450bddab change distro in build file. missing libcrypto on alpine 2020-12-23 14:36:22 +00:00
Roland Sadowski 52ad517e00 add package to build file 2020-12-23 14:31:48 +00:00
Roland Sadowski a8e64e0f57 added .build.yml 2020-12-23 14:27:35 +00:00
Roland Sadowski 4cda60880e reading 1M etc literals
temporary solution, should probably become a new type
2020-02-22 11:07:04 +00:00
Roland Sadowski 871e235a03 line/column numbers for keywords 2020-02-04 19:27:48 +00:00
Roland Sadowski 8a77ab1ad6 keywords namespacing enum 2020-02-01 20:14:27 +00:00
Roland Sadowski dc8100ee2e bump nimble version to 0.2.0 2020-01-30 20:11:03 +00:00
Roland Sadowski f0a2b93697 handle reader conditionals splicing for maps, lists, vectors 2020-01-30 20:09:17 +00:00
Roland Sadowski e0968b3b7d fix: reading unicode chars + tests 2020-01-30 20:08:00 +00:00
Roland Sadowski fe1685b4b6 reading \uDEAD in strings 2020-01-30 18:19:51 +00:00
Roland Sadowski 8100cd9158 reading var quotes 2020-01-29 18:28:10 +00:00
Roland Sadowski 72e24c489e added README 2019-08-23 19:02:47 +01:00
Roland Sadowski 81c2dea208 initial commit
Moved from a non nimble git repo.

This is very alpha quality software.
2019-08-23 18:50:41 +01:00
Roland Sadowski cf5210362e empty project 2019-08-23 18:32:22 +01:00