php - How to prove that two events happened at the same time?
给我你的怀抱
给我你的怀抱 2017-06-24 09:42:21
0
1
757

I know that in computer theory, concurrency does not mean at the same time, but within a certain period of time.

emphasis is within a certain period of time

So will the computer execute an event at the same time?

A single-core CPU is constantly switching, but what about multi-cores, or multiple machines?

[danger] In fact, time is a relative concept, seconds, subtleties, and can be further refined. Theoretically, the same moment exists, but in fact this cannot be proven, because theoretically you know infinite The segmentation will eventually reach a point, but in fact you can't actually prove it. This is a theory that cannot be proven.

Since the same moment exists in theory, how do we prove this through what zone? We believe in time, but the scale of time can be infinitely subdivided, and the scale we can grasp is limited. In other words, we If the hair is the same on the maximum scale, then it is considered to be the same moment?

给我你的怀抱
给我你的怀抱

reply all(1)
学习ing

Shit, this should be a philosophical question. . .
What is the same moment? time1==time2? If infinite subdivision is allowed, your computer cannot represent time1 and time2. This depends on your measurement tool. Your tool is a calendar, then time1 and time2 are just dates. An ordinary watch can count to seconds, and a stopwatch can. To the millisecond level...

Time on a computer is discrete, that is, it is divided by machine cycles T. The duration of each machine cycle is T, which corresponds to the reciprocal 1/f of the processor's main frequency. T is the smallest time unit on the CPU. On a single CPU, each T can only be occupied by one of the events (programs). That is to say, if you use T as the smallest unit of what you call time, then two events cannot occur at the same time on a single-core CPU; on multi-core, each T may be pointed to by multiple cores at the same time, that is, two events may occur at the same time. occur. However, it needs to be considered that if the event is exclusive (such as a multi-core CPU with SMP architecture, which is exclusive when accessing memory), then it is impossible to occur at the same time; on multiple machines, since different CPUs use different CPU clock sources, it is more difficult for you to define At the same time, "two events occur at the same time at the same time" is possible only when T synchronization is ensured.

In fact, all of this depends on your definition of "the same moment". . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!