Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: thread-kill-de…

Sep 03, 2012

  1. Ryo Onodera

    clean up

    authored
  2. Ryo Onodera

    another Thread#kill deadlock

    authored
  3. Dirkjan Bussink

    Merge pull request #1884 from ryoqun/thread-join-deadlock

    Fix Thread#join deadlock from use of Thread#kill and sleep
    dbussink authored

Sep 02, 2012

  1. Ryo Onodera

    Add a spec for dead lock by Thread#kill and sleep

    authored
  2. Ryo Onodera

    Fix timing issue of Thread#kill and sleep

    In some cases, a thread isn't correctly killed by Thread#kill. If that is the
    case, Thread#join on that thread leads to the deadlock.
    
    Consider the following example:
    
        thread = Thread.new do
          sleep
        end
        thread.kill # actually, don't kill
        thread.join # thread lives forever; deadlock
    
    Thread#kill does 2 things to kill a thread:
        1. prepares the thread to be terminated and
        2. wakes up the thread.
    
    Most of time, the wake-up is executed after the sleep in the killed thread.
    
    However, it is possible the wake-up is executed BEFORE the sleep in some rare
    cases. If that is the case, the wake-up does nothing because the thread is
    still waking up at that time. Then, the thread begins to sleep forever. As a
    result, Thread#join never returns.
    
    To avoid such a deadlock, Thread#sleep must check to terminate or not before
    actually sleeping. In addition, it must be asssured that the wake-up isn't
    executed AFTER the check BEFORE the sleep.
    
    The follwing diagrams illustrate the good and bad timings.
    
    Good timings:
    
                     Time
                     ------------------------------------------------------>
        main thread  prepare - wakeup (no-op) |
        new thread                            | check - no sleep - terminate
    
                     Time
                     ------------------------------------------------------>
        main thread                | prepare - wake-up |
        new thread   check - sleep |                   | terminate
    
                     Time
                     ------------------------------------------------------>
        main thread        | prepare |       | wake-up |
        new thread   check |         | sleep |         | terminate
    
    Bad timing:
    
                     Time
                     ------------------------------------------------------>
        main thread        | prepare - wake-up (no-op) |
        new thread   check |                           | sleep forever
    
    To fix the deadlock, this commit makes check_async be called before sleeping
    inside the park mutex.
    authored

Aug 30, 2012

  1. Brian Shirai

    Cleaned up debris from CompiledMethod rename.

    brixen authored
  2. Brian Shirai

    Renamed VMMethod to MachineCode.

    This was a difficult name choice but it is consistent with CompiledCode
    and (not yet used) SourceCode. The CompiledCode is an abstraction of
    computation that is the focal point around which much revolves. MachineCode
    is a representation of computation specialized for our (virtual) machine.
    
    While there is possible ambiguity against the idea of JIT'd machine code,
    our MachineCode is a proper data structure, not just the format of bits
    resulting from the JIT compilation process. Also, our MachineCode is properly
    scoped differently than any such class/concept in LLVM (or more generally,
    the JIT).
    
    Regarding naming of instances of MachineCode, the following rationale is used:
    
    * parameters/variables have been named 'mcode' since the use of the variable
      is elaborated by the surrounding code (ie making ambiguity less an issue)
      and long variable names can sometimes make code unweildy.
    * attributes/fields/accessors have been name 'machine_code' because they have
      less context to disambiguate.
    brixen authored
  3. Dirkjan Bussink

    Implement rb_iter_break()

    dbussink authored
  4. Dirkjan Bussink

    Add specs for rb_iter_break

    dbussink authored

Aug 29, 2012

  1. Dirkjan Bussink

    Add rb_catch and in 1.9 mode rb_catch_obj and rb_throw_obj

    dbussink authored
  2. Dirkjan Bussink

    Add specs for rb_throw_obj and rb_catch_obj

    dbussink authored
  3. Dirkjan Bussink

    Add specs for rb_catch

    dbussink authored
  4. Dirkjan Bussink

    Make sure to parse options before starting the first VM

    dbussink authored

Aug 27, 2012

  1. Brian Shirai

    Merge pull request #1879 from r-stu31/configure_flags

    configure: add CPPFLAGS and LDFLAGS where missing
    brixen authored
  2. Brian Shirai

    Use clang compile flag fix if using clang. Closes #1876.

    brixen authored
  3. r-stu31

    Use CXXFLAGS instead of CFLAGS when compiling c++.

    r-stu31 authored
  4. r-stu31

    Use CPPFLAGS and LDFLAGS when checking libraries, after all, they are…

    … also used afterwards for the real compilation and linking.
    r-stu31 authored
  5. Dirkjan Bussink

    Merge pull request #1875 from LTe/random_range

    Random with range
    dbussink authored
  6. Piotr Niełacny

    Check float type before coerce to Integer

    LTe authored
  7. Piotr Niełacny

    Add spec for rand(Range) when max of range is < 1

    LTe authored

Aug 26, 2012

  1. Merge pull request #1878 from robgleeson/59b878bb9a1acdab0055a83887c1…

    …bb546f9e0e51
    
    Expand "~" from File.absolute_path properly.
    Robert Gleeson authored
  2. Add spec for receiving '~user' in File.absolute_path.

    Robert Gleeson authored
  3. Add failing spec for #1877.

    Robert Gleeson authored
  4. Expand "~" from File.absolute_path properly.

    Fixes #1877.
    Robert Gleeson authored
  5. Dirkjan Bussink

    Handle offsets in arrays properly when sorting

    dbussink authored
  6. Dirkjan Bussink

    Add specs for sorting shifted arrays

    This verifies that sorting still works if implementations use internal
    offsets for arrays.
    dbussink authored
  7. Dirkjan Bussink

    Defer determining terminal width until we create a backtrace

    dbussink authored
  8. Dirkjan Bussink

    Exception for 1.8 mode doesn't seem necessary

    dbussink authored
  9. Dirkjan Bussink

    Use the finalizer lock around finalizer code

    dbussink authored

Aug 25, 2012

  1. Brian Shirai

    Fixes for compiling pty C-ext on linux.

    brixen authored

Aug 24, 2012

  1. Brian Shirai

    Fixed clang warning compiling C-exts.

    brixen authored
  2. Brian Shirai

    Updated C-API copy of transcoder.h.

    brixen authored
  3. Brian Shirai

    Remove extracted transcoding constants and use originial names.

    brixen authored
  4. Brian Shirai

    Added MRI transcoding to our Oniguruma extraction.

    brixen authored
  5. Brian Shirai

    Check file metadata exists when considering rebuild.

    brixen authored
Something went wrong with that request. Please try again.