This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread-safe eval()


you can try using the 'synchronized' form:

http://www.gnu.org/software/kawa/Miscellaneous.html#Miscellaneous


Jost Boekemeier writes:
 > Hi,
 > 
 > kawa fails to run the following simple test code
 > 
 > Scheme s = new Scheme();
 > s.eval(" (letrec ((f (lambda(v) (if (= v 0) 1 (* (f (-
 > v 1)) v)))))(f 155)) ");
 > 
 > when the above code is evaluated in more than one
 > thread.  How do I write the above code so that it can
 > be evaluated in more than one thread at the same time?
 > 
 > 
 > 
 > java.lang.ArrayIndexOutOfBoundsException: 400         
 >                          
 >         at
 > gnu.mapping.Binding.hashSearch(Binding.java(Compiled
 > Code))          
 >         at
 > gnu.mapping.Binding.hashSet(Binding.java:236)         
 >               
 >  
 > 
 > java.lang.Error: ambiguous call to
 > getDeclaredMethod("writeValues", 2)          
 >  -
 > gnu.mapping.Values.writeValues(java.lang.Object,gnu.lists.Consumer)void
 >      
 >  -
 > gnu.mapping.Values.writeValues(java.lang.Object,gnu.lists.Consumer)void
 >      
 >         at
 > gnu.bytecode.ClassType.getDeclaredMethod(ClassType.java:535)
 >         
 >         at
 > gnu.expr.ConsumerTarget.compileFromStack(ConsumerTarget.java:70)
 >     
 >         at
 > gnu.expr.ApplyExp.compile(ApplyExp.java:236)          
 >               
 >  
 > 
 > 
 > 
 > 
 > 	
 > 
 > 	
 > 		
 > ___________________________________________________________
 > Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]