[SDL] Re: threading overhead

Mattias Engdegård f91-men at nada.kth.se
Sun Apr 9 20:34:11 PDT 2000

>Freshly malloc()ed memory sometimes is not actually allocated, but this
>is slightly different from COW, any access (including reading) to the
>page will do the actual allocation, right?

Remember this was Solaris, and I wasn't sure how it handled allocation and
whether it did overcommit. Setting fresh anonymous mappings to COW the zero
page is a quite reasonable implementation, and reading it would just read
one small (8K) physical page.

>My impression is that for a game, it is cache misses that are biggest
>lose, as they mess up things like culling, blitting and mixing.

My impression is that the biggest lose for MT development is the debugging
nightmare :-). I agree about the cache importance though.

The comparatively small overhead in my case probably stems from Solaris
threads being NxM (N API threads mapping on M kernel threads, N >= M),
effectively giving non-preemptive user-mode threading for your benchmark.
I suppose one thread would run to completion, then the other one.

In other words, your benchmark tests whether you are running Linux or not :-)

More information about the SDL mailing list