News for hackers. Stuff that matters.
Re:The Unscalable, Deadlock-Prone, Thread Pool by magnetic on Wednesday February 27, 2019 @10:53AM (#19263961)
If I had all places where memory is allocated under my "jurisdiction", I think this would be a very applicable solution.

Unfortunately when calling APIs to process images, some opaque code that you don't see ends up doing allocations on your behalf, and you can rarely pass your own pool to allocate memory from.

Re:The Unscalable, Deadlock-Prone, Thread Pool by 0db532a0 on Wednesday February 27, 2019 @12:56PM (#19265305)
For the record, mlockall on Linux can lock all future allocations, including those made by shared libraries. You don’t need to manage a memory pool yourself.

https://linux.die.net/man/2/mlock

Re:The Unscalable, Deadlock-Prone, Thread Pool by magnetic on Wednesday February 27, 2019 @01:46PM (#19265802)
That's very cool!

It looks like that API doesn't exist on macOS, though... :-(

Re:The Unscalable, Deadlock-Prone, Thread Pool by 0db532a0 on Wednesday February 27, 2019 @12:53PM (#19265270)
That’s true. I didn’t consider that. I’d be interested love to see a solution to it though. Maybe there’s some sort of OS-level solution, like how you can set the priority of processes.