chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Calling out to C causing hang


From: Chris Double
Subject: [Chicken-users] Calling out to C causing hang
Date: Sat, 5 Apr 2003 20:58:54 +1200
User-agent: KMail/1.4.3

I'm playing around with OpenGL and chicken and have come across a small 
problem. I have the following Scheme code:

(define (main)
  (let* ((d (simplex:open-display))
                 (window (simplex:create-window
                                  d 0 0 640 480 "test")))
        (let loop ()
          (simplex:do-event d)
          (loop))))

This calls C functions wrapped using SWIG (as a loadable module) which creates 
an X window. DO-EVENT calls XPending and if there are any events, processes 
them with XNextEvent.

The code above locks CSI up after after 6 events. The following code works for 
ever (well, for a long time until I've quit):

(define (main)
  (let* ((d (simplex:open-display))
                 (window (simplex:create-window
                                  d 0 0 640 480 "test")))
        (let loop ()
          (gc)
          (simplex:do-event d)
          (loop))))

All I've added is a (gc). If I add the (gc) after the call to DO-EVENT then it 
still locks up. It must be before. Other things work other than GC. For 
example a simple DISPLAY but I'm guessing this eventually triggers a GC and 
that's why it works. 

Any thoughts why this might be occurring? 

Chris.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]