Permalink
Commits on Aug 6, 2011
  1. Documentation updates

    laverdet committed Aug 6, 2011
    - Fibonacci generator example
    - Various clean up
  2. Add Future.prototype.proxy

    laverdet committed Aug 6, 2011
    I end up using this pattern frequently when embedding callback-based
    code inside a future-based sandwich.
Commits on Jul 27, 2011
  1. Bump npm version -> 0.5.0

    laverdet committed Jul 27, 2011
  2. Documentation updates

    laverdet committed Jul 27, 2011
    - Include documentation for Future
    - Minor updates
  3. Basic fiber-aware futures library

    laverdet committed Jul 27, 2011
    This includes a packaged copy of the "futures" implementation I've been
    using with fibers. The library is quite simple but makes working with
    fibers much more manageable.
Commits on Jul 25, 2011
  1. Use libcoro to get away from ucontext for Lion

    laverdet committed Jul 25, 2011
    ucontext in Lion is straight up buggy. These functions have been marked
    as deprecated for a while so it's not totally surprising, but still
    ridic. libcoro has implemented a very similar API using setjmp and
    longjmp internally (among other configurable backends). Switching over
    to setjmp\longjmp, along with the pthread* hook changes fixes fiber
    support in Lion.
    
    Closes gh-28
Commits on Jul 24, 2011
  1. More pthread hook fixing in Lion

    laverdet committed Jul 24, 2011
    The approach from the last commit wasn't totally good enough. It seems
    v8 implements "fast TLS" in some cases which uses inline assembly to
    get at thread locals and there's no way we can hook this. But this is
    only being used for Isolates so they don't need to be fiber-specific.
    To solve the problem when setting a local in FLS it also sets the local
    in FLS. ** This means that in fibers GetExistingThreadLocal and
    GetThreadLocal will have conflicting results ** but so far I haven't
    had any problems.
Commits on Jul 22, 2011
  1. Fix OS X Lion (almost)

    laverdet committed Jul 22, 2011
    dlsym() in Lion now calls pthread_key_create() which breaks an
    assumption coroutine.cc had made, causing infinite recursion. This
    modifies the primordial pthread hooks to work under the new
    constraints. This fix isn't complete as there is still segfaulting I
    haven't quite tracked down yet.
  2. Fix building when node is a symlink

    laverdet committed Jul 22, 2011
    `file` will just say "this is a symlink" and then node may be compiled
    with the wrong bits. There's a flag to force `file` to always follow
    symlinks (the default is not consistent on different platforms).
Commits on May 3, 2011
  1. Bump npm version -> 0.2.6

    laverdet committed May 3, 2011
  2. Fix `node-fibers debug`

    laverdet committed May 3, 2011
    node's debugger is built as a node process which spawns another node
    process. There was an issue where the spawned node process (which runs
    the client code) was not getting shimmed, because coroutine.cc attempts
    to clean up its environment. So I moved the environment cleanup code
    to fibers.js which actually simplified some of the logic there.
    
    Closes gh-25
  3. Make the startup script call exec instead of forking a child.

    ef4 committed with laverdet May 3, 2011
    This change makes it easier to use node-fibers with node-supervisor,
    or any other tool that monitors the health of the node process.  It
    also results in a simpler process structure, and makes "node-fibers"
    closer to a true drop-in replacement for "node".
  4. fixed broken pipe error

    ybogdanov committed with laverdet Apr 8, 2011
Commits on Apr 23, 2011
  1. Documentation updates

    laverdet committed Apr 23, 2011
    - Better installation details with npm>=1.0 instructions
    - Note about fs.readFile + fs.writeFile `length` property
    
    Closes gh-17
    Closes gh-18
Commits on Apr 12, 2011
  1. Bump npm version -> 0.2.5

    laverdet committed Apr 12, 2011
Commits on Apr 3, 2011
  1. Add fiber shim to spawned node processes

    laverdet committed Apr 3, 2011
    It wasn't possible to run node-fibers under a worker because workers are
    implemented as separate processes. This shims child_process.spawn to
    include the fiber shim if you're spawning another instance of node.
    
    Closes gh-20
Commits on Mar 28, 2011
  1. Bump npm version -> 0.2.4

    laverdet committed Mar 28, 2011
  2. Fix failure when multiple fibers finish together

    laverdet committed Mar 28, 2011
    If multiple fibers finished one after in an unexpected way there would
    be a memory leak because `delete_me` would get overwritten. There was an
    assertion in place to prevent this scenario, and a case was discovered
    which triggers this condition. It was actually quite hard to hit because
    the coroutine pool masks this issue very well. The issue was fixed by
    deleting dead coroutines as soon as possible, instead of at the next
    call to run()
    
    Closes gh-16
Commits on Mar 25, 2011
  1. Added w/a for broken node 4.x

    lm1 committed with laverdet Mar 21, 2011
  2. Node fixed streaming from stdin

    lm1 committed with laverdet Mar 16, 2011
Commits on Mar 22, 2011
  1. Fix fibers in strict mode

    laverdet committed Mar 22, 2011
    `yield` is a reserved future keyword in Javascript. Thus in strict mode,
    "yield()" will fail to parse. This adds an alias for yield() on the
    global Fiber object to give you a way to yield in strict mode. The
    global yield() is left for brevity and compatibility.
Commits on Mar 11, 2011
  1. Bump npm version

    laverdet committed Mar 11, 2011
Commits on Mar 9, 2011
  1. Fix broken pipe errors

    laverdet committed Mar 9, 2011
    Node isn't really good at pipes.
  2. (maybe) Fix build for optimizated pthreads

    laverdet committed Mar 9, 2011
    glibc has a #define which defines an inline copy of pthread_equal. This
    is causing build errors, so look for the define and avoid the
    redefinition in this case.
    
    Closes gh-13
  3. Fix `started` property

    laverdet committed Mar 9, 2011
    37d9003 broke the `started` property
    because arguments.Holder() is apparently the wrong function to use for
    accessors.
    
    Closes gh-12
Commits on Mar 3, 2011
  1. Use v8 Signature for instance verification

    laverdet committed Mar 3, 2011
    I was using some SetHiddenProperty hack to prevent segfaults when you do
    something like:
    
      Fiber(function(){}).run.call(null);
    
    I figured v8 had something like this built in but didn't discover it
    until now.
Commits on Feb 24, 2011
  1. Improve discovery of coroutine shim

    laverdet committed Feb 24, 2011
    The fiber-shim script couldn't find coroutine.so on npm installations
    with unexcepted configurations. This makes the script use
    require.resolve() internally which should improve compatibility.
    
    Closes gh-9
  2. Fix `process.title` on OS X

    laverdet committed Feb 24, 2011
    Setting `process.title` caused a segfault on OS X, due to some weird
    craziness that happens in that function. Some OS X libraries call
    pthread_self from threads coroutine.cc has no idea about, and then the
    fun stops.
    
    Closes gh-10
Commits on Feb 23, 2011
  1. Remove rogue GC debugging

    laverdet committed Feb 23, 2011
    I left some GC debugging code in here which impacted performance.
Commits on Feb 22, 2011
  1. Bump npm version to 0.2.0

    laverdet committed Feb 22, 2011
    Also includes some readme changes
  2. Store Fiber.current in a property

    laverdet committed Feb 22, 2011
    By getting rid of the Fiber.current getter and just resetting it every
    time it changes we can drastically speed up access to that property,
    since it saves a trip out of the v8 engine. In most cases it seems like
    people will be using Fiber.current, so this is a good change to make.
  3. Misc refactor

    laverdet committed Feb 22, 2011
    This started off as a diff to keep a Locker active for each coroutine
    even while not in use by v8, which would save the once-per-thread cost.
    Turns out that cost isn't very high, and clearing out the threads is
    better for garbage collection anyway. But the code cleaning up here was
    pretty good so I'm putting this in.
  4. Fix initialization on linux

    laverdet committed Feb 22, 2011
    There's no automatic calls to pthread_key_create in linux, so
    Loader::bootstrap() wasn't getting called before static library
    initialization.
Commits on Feb 20, 2011
  1. Refactor initialization logic

    laverdet committed Feb 20, 2011
    This simplifies initialization into a clear 2-phase dichotomy. The first
    phase runs before malloc is ready, and the second phase is in regular
    initialization. This incidentally plugs a hole where thread-specific
    keys were getting lost early in initialization. I think there's still a
    condition where you could lose data, but OS X and Linux aren't hitting
    it so it's ok for now.