Skip to content

Instantly share code, notes, and snippets.

View jmstacey's full-sized avatar

Jon Stacey jmstacey

View GitHub Profile
@jmstacey
jmstacey / gist:755668
Created December 26, 2010 21:55
rubinius crash report hydra branch
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
0 rbx 0x0000000100054a30 _ZN8rubiniusL12segv_handlerEi + 160
1 libSystem.B.dylib 0x00007fff8499967a _sigtramp + 26
2 ??? 0x00000001043d3178 0x0 + 4366086520
3 rbx 0x000000010020adcd _ZN8rubinius16GarbageCollector4scanEPNS_13ManagedThreadEb + 157
4 rbx 0x00000001002092ab _ZN8rubinius7BakerGC7collectERNS_6GCDataEPNS_17YoungCollectStatsE + 427
@jmstacey
jmstacey / primes.rb
Created December 26, 2010 21:48
Testing threading in the Rubinius hydra branch
# Lucas–Lehmer primality test
# Retrieved from http://rosettacode.org/wiki/Lucas-Lehmer_test
def is_prime?(p)
if p == 2
return true
elsif p <= 1 || p % 2 == 0
return false
else
(3 .. Math.sqrt(p)).step(2) do |i|
if p % i == 0
# see Thread.stop http://ruby-doc.org/core/classes/Thread.html#M000441
a = Thread.new { print "a"; Thread.stop; print "c" }
Thread.pass
print "b"
a.run
a.join
@jmstacey
jmstacey / Prime number generator
Created December 26, 2010 21:36
Testing concurrent threading in the Rubinius hydra branch
# Lucas–Lehmer primality test
# Retrieved from http://rosettacode.org/wiki/Lucas-Lehmer_test
def is_prime?(p)
if p == 2
return true
elsif p <= 1 || p % 2 == 0
return false
else
(3 .. Math.sqrt(p)).step(2) do |i|
if p % i == 0
CVS looks like this:
; $Id: media.info,v 1.2 2009/07/20 23:01:06 jmstacey Exp $
Git changes it to this:
; $Id: media.info,v 1.2 2009-07-20 23:01:06 jmstacey Exp $
Merged (before rebase)
--------------------
jon$ git rev-parse HEAD: upstream/master:
9162e6980666a68810c8ec1bb5226f7fcb1cfaea
aaf7b0e524f8307deca930fdca083103eb778452
Rebased
jon$ git rev-parse HEAD: upstream/master:
cc13fe70b123d08fd0803d6103b3cbffab08c805
aaf7b0e524f8307deca930fdca083103eb778452
jon$ git rev-parse HEAD: upstream/master:
9162e6980666a68810c8ec1bb5226f7fcb1cfaea
aaf7b0e524f8307deca930fdca083103eb778452