跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[硬件] 普通不用 ECC 内存的电脑出现位翻转的概率有多大?

发表于

我记得很久很久以前,V 站有一次讨论要不要上 ECC 的帖子,当时有大佬给出了一段代码,大致是声明一个很大很大的数组,然后全部赋值成 1 ,然后再反复遍历检查,有可能出现值为 0 的结果。但是我现在无论如何都搜不到那篇帖子了。有没有大佬再给写个复现代码?

我拿 Go 写的

package main

import "fmt"

func main() {
	var arg [10000000000]bool

	for {
		for i := 0; i < 10000000000; i++ {
			arg[i] = true
		}
		for i := 0; i < 10000000000; i++ {
			if !arg[i] {
				fmt.Println("位翻转了!")
				return
			}
		}
		fmt.Println("!!")
	}

}

我在 mac 上运行了很久,都没发生翻转,不知道是概率太低还是 golang 的 bool 数据结构有兼容处理

Featured Replies

没有可显示的帖子

创建帐户或登录来提出意见

Account

导航

搜索

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.