TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Simplicity awakes

99 点作者 lkurusa超过 6 年前

4 条评论

Asooka超过 6 年前
Correct me if I&#x27;m wrong, but doesn&#x27;t this suffer from a race condition? What if a process requests an awake, but then gets preempted before doing the blocking system call, and then gets awakened in response to its awake request (rather than because of normal scheduling)? Its awake request was already serviced, so if it performs a blocking syscall, it will wait indefinitely.<p>Alternatively, if the awake request is only done when a blocking syscall is done, doesn&#x27;t it then suffer from the problem that a random buggy library function could request an awake without then doing a blocking syscall (due to whatever logic bug), so then when the process does a blocking syscall that it expects to block indefinitely, it instead gets a syscall with a timeout?<p>Wouldn&#x27;t it be better for the awake syscall to take another syscall as a parameter (pretty simple to do in assembly and should be provided as a C library wrapper), in order to guarantee atomicity?
评论 #18477995 未加载
评论 #18478384 未加载
评论 #18479915 未加载
codazoda超过 6 年前
&quot;The design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design.&quot; - <a href="http:&#x2F;&#x2F;jehanne.io" rel="nofollow">http:&#x2F;&#x2F;jehanne.io</a><p>I&#x27;ve been looking for examples of good comments about simplicity to help focus my own view of simple. I love the quote above.
评论 #18476354 未加载
评论 #18477947 未加载
评论 #18482372 未加载
mcguire超过 6 年前
&quot;<i>In a way the so called “New Jersey style” was a rush for a minimum viable product able to minimize the time-to-market and to gain the first mover advantage.</i>&quot;<p>Another way of looking at it is that it is an attempt to get something into existence, rather than waiting years for perfection and ending up with nothing. To paraphrase performance work, something is infinitely better than nothing.<p>I am somewhat interested in the comment, &quot;<i>(the mindful reader will notice that alarm is still waiting to be moved to user space… the fact is that it’s too boring of a task!)</i>&quot; I originally interpreted it as meaning userspace could interrupt the blocking call, but I see its actually a filesystem that interacts with kernel space.<p><pre><code> fd = create(&quot;&#x2F;dev&#x2F;alarms&#x2F;new&quot;, ~0, pair_ints(getpid(), ms)) </code></pre> Been a long time since I have looked at Plan 9; create has some interesting arguments.
评论 #18476317 未加载
zeroname超过 6 年前
&gt; [asymptotic graph trending towards doom]<p>&gt; How many programs are you running right now? :-D<p>I don&#x27;t even know, there are probably thousands of processes running right now, totaling hundreds of millions of lines of code.<p>And it all works <i>perfectly fine</i>, especially as long as I don&#x27;t update anything. I just don&#x27;t do the things that don&#x27;t work. The things that don&#x27;t work, they generally don&#x27;t work 100% of the time. The things that <i>do</i> work, they generally work 100% of the time. Some software might fail randomly and frequently, in which case I might not use it either, unless failure is easily recovered from (which is often the case).<p>I don&#x27;t need a system that is really simple and (as a consequence) super-reliable. I need a system that <i>runs my software</i> and that is fault-tolerant. After all, even entirely correct software cannot prevent hardware faults (which do occur).
评论 #18479980 未加载