Projects
THC Projects
THC
THC is a language that adds a few interesting features to C for performing asynchronous IO without the need for threads or stack-ripping event handlers.
async {s}- Execution proceeds intos. Ifsblocks (e.g. on IO), execution proceeds at the statements following theasyncstatement. When the blocking operation insfinishes, execution may return to that point if it becomes blocked somewhere else.asyncstatements must be syntactically enclosed in ado..finishstatement.do {s} finish- Blocks until execution has reached the end of allasyncstatements ins.cancel- Causes all cancelable, blocking operations within the enclosingdo..finishstatement to abort and return a value indicating cancellation.
Projects
- Static Analysis of THC to find programming errors
- Normally, THC programs run sequentially. That is, only one operation is executed at any time. However, if it can be determined that async statements that may-happen-in-parallel won't touch the same unsynchronized locations (e.g. shared locations not protected by a lock or atomic section), then the two async statements may safely be run concurrently in separate threads. This project would entail implementing this feature.
- Consider a webserver written in THC. A webserver may block in several places while serving a single request. The order in which the THC runtime reschedules async statements when blocking operations in them finish will affect the time it takes requests to be served. This project involves investigating ways to ensure fair allocation of server resources to clients making requests to a server written in THC.