DateTime.Now导致IO阻塞? [英] DateTime.Now causes IO blocking?

查看:158
本文介绍了DateTime.Now导致IO阻塞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新闻发布会上有人告诉我, DateTime.Now 导致IO阻塞,这东西我从来没有停下来考虑。如果是这样,为什么?

On a conference someone told me that DateTime.Now causes IO blocking, something that I have never stopped to consider. If it does, why?

推荐答案

没有人迄今已回答其中当前时间确实来自何处。我不是最新的最新的PC架构。但在几年前,所述实时时钟的是外侧的芯片的一部分CPU(南桥)。因此,要获得的时候,你不得不做一些I / O操作与芯片。 (这不是磁盘访问,但仍然是一个I / O操作。)

Nobody so far has answered where the current time is really coming from. I'm not up to date with the latest PC architecture. But a few years ago, the real-time clock was part of a chip outside of the CPU (south bridge). So to get the time, you had to do some I/O operations with that chip. (It's not disk access but still an I/O operation.)

此外,由于当前进程必须等待从时钟的答案,它的阻塞I / O。

And since the current process has to wait for the answer from the clock, it's blocking I/O.

这样的人在会议上是正确的。

So that person on the conference was right.

这篇关于DateTime.Now导致IO阻塞?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆