[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Pushing events between C++ and Scheme + timers
From: |
Joel Reymont |
Subject: |
Re: [Chicken-users] Pushing events between C++ and Scheme + timers |
Date: |
Wed, 8 Dec 2004 19:46:01 +0000 |
> felix winkelmann wrote:
>Does the loop run continuously? You could call into Scheme periodically,
>for example by checking timeouts for all suspended game states. If the
>call into Scheme happens periodically, you could run a separate
>(Scheme-level) background thread to check for this.
Yes, the Scheme event-checking loop would run continuously and the C++
loop would run continuously as well. When you say background Scheme-level
thread you mean starting a thread in Scheme?
>You can pass an incoming event as an s-expr to the Scheme side,
>and receive the reply s-expr as a string as result, passing it back.
That's what I want to store in the queues. Can these queues be simple
Scheme lists?
Could I implement timers by launching a separate Scheme thread and having
it post an event to the "incoming" queue/list?
I thought I could have 3 Scheme functions I would call from C++ where one
would start the Scheme loop in a Scheme thread and the other two would
let C++ post events (sexp) to the "incoming events" Scheme list and the
other would retrieve them from the "outgoing" list. The post/retrieve
functions would use a mutex to block access to the lists/queues. Then I
could do the timer by launching another thread within Scheme.
What am I missing?
Thanks, Joel
--
OpenPoker: The Linux of poker software
http://wagerlabs.com/forums