aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-07-18 03:10:03 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitec1a48e7b86fcd00127dd5a88d56c42083af1d78 (patch)
tree7e6423f20fa795bbba8cbc5ead8bc8a3f7289d2e /include/ast.h
parent84e65c63e7482590d535e86f7660a00ae8a0cecb (diff)
Setup structure for program execute
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/ast.h b/include/ast.h
index 2925f6c..f056db7 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -142,9 +142,12 @@ typedef struct {
} VariableType;
/*
- Note: When resolving AST, more than one thread can end up resolving the same expressions at the same time.
+ Note: When resolving AST, multiple threads can end up resolving the same expressions at the same time.
This is intentional. Instead of using mutex for every expression and locking/unlocking everytime
which uses more memory and affects performance, we assume such race conditions are rare and let them happen.
+ TODO: Investigate possible deadlock when multiple threads resolve the same expression and that
+ expression has a recursive dependency and the threads execute @ast_resolve at the same speed,
+ leading to @ast_resolve running again for the same expression.
*/
struct LhsExpr {
bool is_extern;
@@ -210,7 +213,7 @@ typedef struct {
Parser *parser; /* Borrowed. This is the parser that belongs to the thread */
/*
Borrowed. This is the current scope. Note that this scope can belong to another parser (and thread),
- as such, @parser and scope_get_parser(@scope) parser may not be the same
+ as such, @parser and scope_get_parser(@scope) parser may not be the same.
*/
Scope *scope;
} AstCompilerContext;