5 ms·
> How do Chrome and Firefox (and Safari I suppose) give their worker processes P-cores while users are interacting with the browser window process? Generally i
by ninkendo 5y ago
> How do Chrome and Firefox (and Safari I suppose) give their worker processes P-cores while users are interacting with the browser window process?
Generally if a UI process makes IPC calls out to a daemon or other process, the Mach kernel is supposed to keep track of prioritization and an on-behalf-of relationship for the daemon. That is, if the kernel already thinks the foreground app is P-core eligible, any work it initiates in other processes via IPC should be P-core eligible as well, through a “voucher” object that is passed between processes: https://opensource.apple.com/source/xnu/xnu-3789.41.3/osfmk/ipc/ipc_voucher.h.auto.html https://opensource.apple.com/source/xnu/xnu-3789.41.3/osfmk/...
I’m not sure the mechanism you’re using to put video playback out-of-process, but if there’s any IPC calls involved, make sure they’re originating from a UI task, and not the other way around? Hopefully this gives you something to go on.
- nyanpasu64 5y agoFrames are passed through a Unix pipeline (to stdin rather than a named pipe). What's a UI task?
- conradev 5y agoIs the python process a direct child of the UI process?
- nyanpasu64 5y agoThe Python thread shares a process with the GUI thread. It actually pipes data to a ffmpeg process in between, to mix video frames and audio into a NUT stream, which gets piped to the ffplay GUI process. IIRC both processes are created by Python, but we only pipe data directly into ffmpeg.