Subject: Re: Status report: sysmon_cpufreq(9) + powerctl(8)
To: Juan RP <juan@xtrarom.org>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 09/28/2006 22:00:38
On Thu, 28 Sep 2006, Juan RP wrote:
> Any more suggestions about the code?
simple_lock(&sysmon_cpufreq_slock);
error = prop_dictionary_copyout_ioctl(plist, cmd, DEV_PROP_D);
simple_unlock(&sysmon_cpufreq_slock);
I am not sure that this is altogether safe - if the copyout sleeps because
ENOMEM, and another thread tries to get the lock in the meantime does that
not just lock the CPU? (is a spinlock required?)
If another thread changes the dictionary during the externalize, I *think*
it will just break the iterators and you will get an error. Jason?
iain