简体   繁体   中英

Creating a GCD queue for a specific NSThread

I would like to create a thread for offline rendering with its own OpenGL context.

For submitting rendering tasks, I would like to use GCD, due to its API simplicity.

Is it possible to create a GCD queue that is attached to a specific NSThread (which has its own OpenGL context)?

It seems to be possible, since the main queue always runs it tasks on the main thread, but I could not find anything with similar behavior for custom threads.

You can set the current context at the beginning of every task, as described here: "OpenGL Restricts Each Context to a Single Thread" .

You can also set a context for the dispatch queue, as explained here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM