Subject: Re: Condition variables
To: Eduardo Horvath <email@example.com>
From: Darren Reed <firstname.lastname@example.org>
Date: 06/07/2000 02:52:49
In some email I received from Eduardo Horvath, sie wrote:
> Let's say I want to wait on a particular `vm_page_t'. The `vm_page_t'
> needs to contain a `condvar_t'. Or more precisely *every* `vm_page_t' in
> the system needs to contain a `condvar_t' even if it's only used in one
> piece of code. If you have 1 byte `condvar_t' and 1000 pages of RAM
> that's 1K. If the `condvar_t' is a pointer in LP64 that's 8K. (Ignoring
> structure alignment and packing issues that may waste more space.)
Ah. I've never used condvar_t's in such quantity :) I do see a tsleep()
on a "map" which is a `vm_map_t', so you're not far off. I understand now
how keeping a tsleep(), which uses its own lock, has its advantages.