Fix Issue #3
Merge pull request #4 from slackbot/master

Fix for Issue #3
Declare debug macros as nothing for release builds. Fixes #2
[readme] Added link to intro article
An early implementation of hierarchical tasks. When a task A spawns a new task B, B retains a reference to A. If B dies before A, A is dereferenced (B releases its reference). If the supertask A dies before B, a specialized garbage collector (called CheckZombie) is executed which will clean up (kill off) any subtasks. Each level of subtasks will be kileld in cycles, so to avoid resource usage spikes when collecting large number of subtasks. However, this implementation and design is restricted to a single OS thread as we rely on control flow and memory state. It is possible to use locking and counting to allow multiple OS threads, but that would make this design inefficient. A networked model is impossible due to the heavy use of shared memory.
Added Multiple Producer, Single Consumer lock-free FIFO message queue. This little guy only cost a single XCHG (for the producer, best-case scenario) and worst-case additionally one XCHG for the consumer. Benchmarks show very good numbers. When there are 2-7 producers (each running on a separate OS thread) and one active consumer (which is running on yet another separate OS thread, sitting in a loop just trying to dequeue), the average time taken for one transaction (malloc message, enqueue, dequeue, verify, free) is 120 nanoseconds on a 2.3 GHz Intel Core i7, 1600 MHz DDR3 memory (MacBook Pro late 2012). Graph: http://farm9.staticflickr.com/8192/8099092455_ec05f646df_b.jpg
[breaking wip] Added preliminary Task Identifier map together with a new task structure.
Woho. Epic commit with hierarchical tasks, function calls, SPAWN instruction, task message passing, etc etc. Still WIP, but tests pass and main.c runs
Remove unused tidmap
Remove unused tidmap
Note on arec struct size
- Bunch of updates to the build system.
- More and better tests.
- Added `DBGCB` instruction for debugging programs by executing custom code "in the task" at any time.
- Logging output stream can be set at runtime (`FILE* SLogStream` replaces `S_LOG_STREAM`)
- Fixed a bug with timers where a task's "waiting for" was not cleared after a timer fired, causing a segfault when the task was collected since `_EndTask` will call `_TimerCancel` if the "waiting for" status is `STaskWaitTimer`, which in turn will cause a segmentation fault in libev when trying to access the already free'd timer.
- Fixed a bug in `_SchedExec` with arithmetic operations where the type of the resulting value would not be set to `SValueTNumber`.
- Fixed the implementation of the `NOT` operation to assign `SValueTFalse` or `SValueTTrue` to the result instead of just `y = !x`.
- Added a new value type `SValueTOpaque` which represents any pointer. Used by values refrenced by the `DBGCB` instruction (the referenced values holds pointers to c functions).
Added programming test of timers and cleaned up the "basic" programming test
Proper clean-up in test_prog_basics.c
Readme
Update lab/task-message-passing-take2.md
Update lab/task-message-passing-take2.md