út 12. 12. 2023 v 22:23 odesílatel John Kacur <jkacur@xxxxxxxxxx> napsal: > Oops, your code is correct but you left in the old wrong explanation > you need to fix this up before I can apply this. > Yeah I completely missed that! > Are you sure you want to remove this? We have three states, > 1. cpu is online > 2. cpu is offline > 3. cpus is not legitimate, ie, we have 12 cpus and the code asks > whether cpu number 1000 is online > I think you're trying to write more elegant code than the original > implementation, but is it safer? Should we maybe check if the path > exists before calling sysread()? > What I didn't like about the original implementation was that checking if a CPU is online has little to do with the CpuList object. Thus, I made it static and removed the CpuList argument (self). I agree that the proper solution is to check if the CPU exists in the system (instead of in the cpulist), not removing the check altogether. Tomas