diff options
Diffstat (limited to 'include/ast.h')
-rw-r--r-- | include/ast.h | 7 |
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; |