4 ms·
Has anyone used these to write interrupt service routines? Seems like there's an opportunity here. You can take your existing synchronous code and not have to r
by evancox100 8y ago
Has anyone used these to write interrupt service routines? Seems like there's an opportunity here. You can take your existing synchronous code and not have to rewrite it into something like continuation-passing style. This is a source of a lot of bugs.
- nraynaud 8y agoI have, it's not pretty either: https://github.com/nraynaud/webgcode/blob/gh-pages/interpolator/main.c#L156 https://github.com/nraynaud/webgcode/blob/gh-pages/interpola...
- convolvatron 8y agoi have done cps plumbing in C with poor mans closures for the entire interrupt path, and given its natural event-like nature, it really all comes out pretty nice.
- srean 8y agoIf its possible would love to learn from it. Any chance of taking a look at it ?
- convolvatron 8y agothe actual work was done under contract as in proprietary, but the closure library is the interesting part, is owned by me, and something i can send you. accountname @gmail.com if you're interested we can go over the interrupt path, its pretty straightforward at that point. by flipping the control flow around, the virtio virtqueue support for example becomes nice and self-contained. it provides an interrupt continuation to the interrupt layer, and each queue is initialized with a continuation to call on a dequeue. vector assignment is still a bit cross-cutting.
- srean 8y agoThanks that is extremely generous of you. I would still encourage that you put it up somewhere with a license of your choice. Many would get an opportunity to learn a thing or two.