Some responses: (apologies for not doing them as inline, but my phone hates me right now)
Dynamically loading additional builtins sounds rather useful.
As for threading, it would be really difficult / dangerous if implemented badly. That said, I do have a way it could be safely thrown into the existing server without issue: (borrowing from the concept of c#'s async keyword)
- All tasks run on the primary thread by default.
- There is a builtin that takes a reference to a verb, and executes it on an additional thread (But without any perms)
- The builtin returns an ASYNC var.
- Thread execution continues on both, until the primary verb tries to reference the ASYNC.
- The primary verb is forcibly suspended until the secondary thread finishes
- The ASYNC is replaced with the return value if the secondary thread.
- Primary verb resumes, and uses the newly replaced value.
This method retains the thread safety inherent in LambdaMoo (because secondary threads are unable to change anything), while still allowing complicated and resource consuming operations to be outsourced to additional threads.
The idea of 'atomic verbs' would be difficult for two reasons:
- The inability to track which verb has changed things. This could be fixed easily if we didn't use a flatfile, because each db operation could record the taskid that caused it
- More importantly, the idea that if an 'atomic verb' suspended, let another verb reference it's "results", then rolled back. How would this be dealt with? What should the other verb do with this ghostly data. How would it even know?
And preventing other verbs from acting whilst an atomic verb is suspended would counter the point if suspending in the first place.
-Stephen
--
You received this message because you are subscribed to the Google Groups "MOO Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to MOO-talk+u...@googlegroups.com.
To post to this group, send email to MOO-...@googlegroups.com.
Visit this group at http://groups.google.com/group/MOO-talk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.