TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Why can't OS have dedicated cores and memory?

10 pointsby uptownhralmost 8 years ago
Have you ever experience your mouse and keyboard input start to lag?<p>Why is it that you are not able to dedicate a core or a thread to your OS so, third party apps do not have access to them? This can prevent your entire OS from locking and your entire experience being jerky.

7 comments

detaroalmost 8 years ago
There are a lot of issues where dedicated cores don&#x27;t help - e.g. locking issues (see the discussion today about windows and chromium builds)
评论 #14740460 未加载
davelnewtonalmost 8 years ago
You can, at least in Linux. But in general the OS will do a better scheduling job than you will.
评论 #14738926 未加载
LoSboccaccalmost 8 years ago
Mostly because the os needs to coordinate everything and not all operations can be interrupted. Operating system maintain each program illusion to be alone on the hardware, virtualizing disk transfers, memory mappings, display regions and all the other hardware. Some operations once queued and dispatched need to complete before other operations can be accepted - that might happen for example when the os is figthing to access a memory page from disk but the disk is busy in a large dma transfer - then the illusion of being alone comes crashing down and no clever scheduling can fix it, because a class of operations without a guaranteed time constraint exist on the ibm pc platform.<p>Without a hard real time guarantee from the hardware, everything built on it cannot provide a guarantee on dispatching only the exact amount of operations that the system can handle.<p>And that happens even before accounting that the os or some driver within may have some cpu locking going on.
LinuxBenderalmost 8 years ago
This isn&#x27;t specific to your question, but I have VM&#x27;s that have 6 logical processors. I use taskset to set the affinity of all OS processes to logical proccesor 0. This doesn&#x27;t work for some kernel threads, but it works for most processes. I then give haproxy a number of logical processors, or balance based on what is running on that VM.<p>On physical hardware I would use NUMA regions per set of applications as well to optimize the use of CPU cache and get lower latency to memory, but the overall memory availability will be reduced. This is done on some latency sensitive applications.<p>You can do similar things in Windows. There is probably a way in Mac, but I have never tried.<p>As others pointed out, there are many cases where doing all of this won&#x27;t help, so it really depends on the problem you are trying to solve, or the optimization you wish to accomplish. There are certainly no one-size-fits-all solutions.
rb808almost 8 years ago
<a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Processor_affinity" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Processor_affinity</a><p>In my experience we used affinity with older CPUs to improve single thread performance. Recently it doesn&#x27;t make much difference.
uptownhralmost 8 years ago
Feels like there isn&#x27;t a solution using current OSes.<p>Why does CPU locking exist? I&#x27;m sure this is pretty technical question but if anyone has a dumb answer for me... Is this something impossible get rid of? Can it be scoped to a core and not the entire CPU?
zamalekalmost 8 years ago
iOS supposedly runs the UI thread at maximum priority on phones, which is similar to what you are suggesting here.