綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] 請問 vsync fsync是在幹嘛的?

[複製連結] 查看: 1242|回覆: 1|好評: 0
跳轉到指定樓層
樓主
benny8197 | 收聽TA | 只看該作者 回帖獎勵 |正序瀏覽 |閱讀模式
發表於 2013-6-16 20:25

馬上加入Android 台灣中文網,立即免費下載應用遊戲。

您需要 登錄 才可以下載或查看,沒有帳號?註冊

x
請問 vsync  fsync是在幹嘛的?
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
jinnib04792 | 收聽TA | 只看該作者
發表於 2013-6-18 20:11
本帖最後由 jinnib04792 於 2013-6-18 20:15 編輯

vsync (垂直同步)
http://www.coolaler.com/showthread.php/200417-%E8%AA%8D%E8%AD%98%E3%80%8E%E5%9E%82%E7%9B%B4%E5%90%8C%E6%AD%A5(vsync)%E3%80%8F%EF%BC%8C%E7%AF%80%E8%83%BD-%E5%8F%88-%E8%AD%B7%E7%9B%AE

fsync
http://linux.die.net/man/2/fsync
(我不知該如何解釋 ... 自己看一下吧)

Q: What kind of data may be lost when fsync is disabled? could you please give an example? may it cause a serious damage to the phone\\\'s system?

All data that any app thinks it has written to storage (as it explicitly instructed the OS to do so), but has not been written yet by the OS, may be lost in case of an unexpected system crash.

So as long as the system is running normally, all cached data is eventually written to the eMMC/SD, usually a few seconds after the write request, and everything works normally.

In case of a random reboot, or a \\\"hard\\\" system hang which requires you to power off and restart, or if you run out of battery, AND some app or background service wanted to write something to the file system just before that crash, such cached data is lost.

So what can happen? No hardware is damaged. In the absolutely worst case, the filesystem on your data partition is irrecoverably damaged and you have to do a factory reset, losing all your apps and your data, photos etc. (you do have a backup, don\\\'t you?). The chance for this worst case to happen is extremely low - in most cases the filesystem is automatically repaired at startup, and the incompletely written files are simply deleted. If this does not work for some reason, you can still manually try running fsck from the recovery.

If some system service just updated a database before the crash, it may be inconsistent after restarting. This can lead to malfunction of that service, e.g. FCs, missing info in your calendar, missing or garbled media files, etc.

So in summary - as long as the system is stable, disabling fsync only increases performance. By the way, app crashes (FC, ANR, ...) do not hurt here, only complete system crashes are bad.

(截錄至:http://forum.xda-developers.com/showthread.php?p=33381928)
用Android 就來Android 台灣中文網(https://apk.tw)
回覆 支持 反對

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則