[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

continuation called across trap

Young Hyun

8/24/2006 5:57:00 PM

Does anyone know what the rather mysterious error "continuation
called across trap" means? It's triggered when I use SyncEnumerator
in a multithreaded script. I don't believe I'm doing anything
obviously wrong with threads, but this error disappears if I don't
use threads. Furthermore, the error seems to occur when I use irb
but not ruby (?? I need to verify this). I'm suspecting there might
be a bug in irb. Code to reproduce the problem is below. Note,
also, that the problem disappears if you remove the use of
@values.find--that is, if you call SyncEnumerator.each directly in
the lambda.

--Young

=============================================
require 'thread'
require 'generator'

class Region

def initialize
@values = []
@work_queue = Queue.new
@thread = Thread.new do
loop do
@work_queue.deq.call
end
end
end

def add(value)
@work_queue << lambda do
@values << value
end
end

def find(template)
@work_queue << lambda do
@values.find do |value|
SyncEnumerator.new(template, value).each do |lhs, rhs|
puts "checking: #{lhs.inspect} === #{rhs.inspect}"
end
end
end
end

end

Thread.abort_on_exception = true

reg = Region.new
reg.add [1,1]
reg.add [1,2]
reg.add [1,3]

reg.find [1,2]

#sleep 10 # uncommenting this somehow prevents the error

=============================================
MacOS X 10.4.7
$ ruby --version
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.5.0]
$ irb --prompt-mode simple
>> load 'Fail4.rb'
checking: 1 === 1=> true
>>
/opt/local/lib/ruby/1.8/generator.rb:132:in `call': continuation
called across trap (RuntimeError)
from /opt/local/lib/ruby/1.8/generator.rb:132:in `next'
from /opt/local/lib/ruby/1.8/generator.rb:225:in `each'
from /opt/local/lib/ruby/1.8/generator.rb:220:in `each'
from /opt/local/lib/ruby/1.8/generator.rb:217:in `each'
from ./Fail4.rb:25:in `find'
from ./Fail4.rb:2:in `find'
from ./Fail4.rb:24:in `find'
from ./Fail4.rb:11:in `initialize'
from ./Fail4.rb:10:in `initialize'
from ./Fail4.rb:9:in `initialize'
from ./Fail4.rb:36
from (irb):1:in `irb_binding'
from /opt/local/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding'
from /opt/local/lib/ruby/1.8/irb/workspace.rb:52

3 Answers

terrasbeest@gmail.com

6/14/2012 7:26:00 PM

0

Op donderdag 14 juni 2012 21:07:36 UTC+2 schreef Jonathan het volgende:
> On Thursday, June 14, 2012 11:35:48 AM UTC-4, Gerry wrote:
> > On 2012-06-14 14:48:39 +0000, Jonathan said:
> >
> > > I have learned a lot from Howard Morgan's books over the years
> > > (especially "Concepts,") and this seems to be the culmination of his
> > > life's work (at least it seems to be billed that way).
> >
> > What's the thrust of it?
> > --
> > If one plays good music, people don't listen and if one plays bad music
> > people don't talk. -- Oscar Wilde
>
> It purports to be a comprehensive system for visualizing patterns and relationships on the fretboard.
> It consists of a series of 23 instructional videos and a 132 page PDF manual.
> Truefire is selling it via download for 40 bucks:
>
> http://truefire.com/jazz-guitar-lessons/fingerboard-bre...

Have it. Excellent.

Jonathan (not from Cleveland)

6/15/2012 1:53:00 PM

0

On Thursday, June 14, 2012 3:26:18 PM UTC-4, terrasbeest wrote:
> Op donderdag 14 juni 2012 21:07:36 UTC+2 schreef Jonathan het volgende:
> > On Thursday, June 14, 2012 11:35:48 AM UTC-4, Gerry wrote:
> > > On 2012-06-14 14:48:39 +0000, Jonathan said:
> > >
> > > > I have learned a lot from Howard Morgan's books over the years
> > > > (especially "Concepts,") and this seems to be the culmination of his
> > > > life's work (at least it seems to be billed that way).
> > >
> > > What's the thrust of it?
> > > --
> > > If one plays good music, people don't listen and if one plays bad music
> > > people don't talk. -- Oscar Wilde
> >
> > It purports to be a comprehensive system for visualizing patterns and relationships on the fretboard.
> > It consists of a series of 23 instructional videos and a 132 page PDF manual.
> > Truefire is selling it via download for 40 bucks:
> >
> > http://truefire.com/jazz-guitar-lessons/fingerboard-bre...
>
> Have it. Excellent.

Cool.
Could you expound on it a little?
What sets it apart from other books/methods?
Given Morgan's concentration on chord melody, I would guess that it's geared towards finding chord inversions on the fly for harmonizing melody notes...
Is that the case?

terrasbeest@gmail.com

6/15/2012 8:06:00 PM

0

Op vrijdag 15 juni 2012 15:52:52 UTC+2 schreef Jonathan het volgende:
> On Thursday, June 14, 2012 3:26:18 PM UTC-4, terrasbeest wrote:
> > Op donderdag 14 juni 2012 21:07:36 UTC+2 schreef Jonathan het volgende:
> > > On Thursday, June 14, 2012 11:35:48 AM UTC-4, Gerry wrote:
> > > > On 2012-06-14 14:48:39 +0000, Jonathan said:
> > > >
> > > > > I have learned a lot from Howard Morgan's books over the years
> > > > > (especially "Concepts,") and this seems to be the culmination of his
> > > > > life's work (at least it seems to be billed that way).
> > > >
> > > > What's the thrust of it?
> > > > --
> > > > If one plays good music, people don't listen and if one plays bad music
> > > > people don't talk. -- Oscar Wilde
> > >
> > > It purports to be a comprehensive system for visualizing patterns and relationships on the fretboard.
> > > It consists of a series of 23 instructional videos and a 132 page PDF manual.
> > > Truefire is selling it via download for 40 bucks:
> > >
> > > http://truefire.com/jazz-guitar-lessons/fingerboard-bre...
> >
> > Have it. Excellent.
>
> Cool.
> Could you expound on it a little?
> What sets it apart from other books/methods?
> Given Morgan's concentration on chord melody, I would guess that it's geared towards finding chord inversions on the fly for harmonizing melody notes...
> Is that the case?

I have not seen those books/ methods, so I can't comment.
There's a couple of sample vids of this course on Youtube, should give you an idea.