Skip to content

Integrate with Coro::State or similar in callbacks #87

Closed
kthakore opened this Issue Jul 26, 2011 · 3 comments

1 participant

@kthakore
PerlGameDev member

SDL makes heavy use of callbacks, so it is important to make it work as coroutines, so that the code interrupted by a callback is reified later.

This also potentially solves the issue with threads and timer, since the timer thread could simply signalize the main thread to switch to a different coroutine, instead of trying to execute the code in the foreign thread...

Usually, for every callback in SDL there's always a pointer for "user defined data", this can be used to store the closure to be called, then the current interpreter state could be sent as a parameter to be reified at the end of the callback in a Continuation Passing Style.

@kthakore kthakore was assigned Jul 26, 2011
@kthakore
PerlGameDev member

Author: ruoso
Time: 1262649114
Field: status
Value: closed

@kthakore
PerlGameDev member

Author: ruoso
Time: 1262649114
Field: resolution
Value: fixed

@kthakore
PerlGameDev member

Author: ruoso
Time: 1262649114
Field: comment
Value: In the end, the solution was to implement it using threads instead of coro::state, but it does work just fine.

@kthakore kthakore closed this Jul 26, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.