From: Josef W. <jw...@ra...> - 2014-03-10 23:10:21
|
On Mon, Mar 10, 2014 at 06:44:16PM +0100, Stelian Ionescu wrote: > Make it multi-threaded, and keep in C the part that enqueues the frames > into a ring buffer. If using a lock, you'd have to be careful that the > consumer thread written in CL doesn't hold it while in GC, because that > would block the writer. I wonder how I'd go about this. Either the Multithreading would be done from C, then I'd need to fiddle with SBCL internals. Or the multithreading would be done in CL, then I'd need a way to suppress GC in the writer thread. After all, the GC _can_ be run in the writer thread, won't it? I don't see how to force GC to be run in a specific thread. If there were such a mechanism, I could simply create a task solely for the GC. Let's assume I'd use multitaksing: when GC is run in one task, would the other threads block when the need to cons? I guess the GC would use some locking internally, won't it? And how would I ensure that GC won't be run while the lock is held? I can't find any methods to suppress GC. Would it be enough to call GC right before ackquiring the lock? Let's assume I have a thread that don't do any consing at all. Can I safely assume that the GC would never run in thins thread? -- Josef Wolf jw...@ra... |