My Cocoa app needs to simultaneously render many batches of generated web pages. Since WebKit WebView rendering is restricted to the main thread, I can't use GCD to do this within the application's process, so I'm looking at using some sort of inter-process solution.
NSXPCConnection
is the obvious choice, since it plays nice with the sandbox and transparently proxies all the Core Foundation types I'll need to work with. However, it appears to only ever create a single process per service, which just moves my main-thread-restriction into a different process and doesn't let me parallelize multiple rendering requests. Is there any way to convince the XPC system to fork multiple processes for the same service, possibly using the C API (xpc_connection_create
, etc.)?
At this point I'm considering make a dozen identical XPCServices
bundles with different names and connecting to whichever ones are idle for a particular batch of parallel render requests, but that just seems silly.