notes:internals:db
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| notes:internals:db [2025/09/07 01:29] – smj-edison | notes:internals:db [2025/09/08 19:27] (current) – smj-edison | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Database ====== | + | ====== Database |
| //If you want to follow along in the code, all of these things are implemented in trie.c, db.c, folk.c, | //If you want to follow along in the code, all of these things are implemented in trie.c, db.c, folk.c, | ||
| Line 39: | Line 39: | ||
| - We add " | - We add " | ||
| - We preserve both the query and the code (that' | - We preserve both the query and the code (that' | ||
| - | - We add "with environment {foo bar}", as Tcl doesn' | + | - We add "with environment {foo bar}"‡, as Tcl doesn' |
| ==== Reacting to Statements ==== | ==== Reacting to Statements ==== | ||
| Line 76: | Line 76: | ||
| === When scheduling === | === When scheduling === | ||
| - | One exciting thing about folk2 is its support for multithreading. It does this by running | + | One exciting thing about folk2 is its support for multithreading. It supports |
| - | on its own thread. That means that when a Statement matches with a When, it needs to be queued for the next | + | to run on a thread |
| available thread to pick it up. That's exactly what happened in this example. The Wish got inserted, | available thread to pick it up. That's exactly what happened in this example. The Wish got inserted, | ||
| it checked for matching Whens, and then when it found a match, it pushed it to the work queue to be run | it checked for matching Whens, and then when it found a match, it pushed it to the work queue to be run | ||
| Line 164: | Line 164: | ||
| the last Term in `Wish $this has name "Mason Jones" | the last Term in `Wish $this has name "Mason Jones" | ||
| space seperated by default, and all the database commands are called from Tcl. | space seperated by default, and all the database commands are called from Tcl. | ||
| + | |||
| + | ‡ This is simplified for explanation reasons. This is actually a list of environments, | ||
| + | entry being one level higher in the call stack. | ||
notes/internals/db.txt · Last modified: by smj-edison
