You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-29Lines changed: 41 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,42 +62,54 @@ void dsync_foo() {
62
62
```
63
63
3. Special case of `fsync`: Since `fsync` is an `fsync_wrapper` too, it must get its own version of osync definition and dsync definition. And it does! The osync definition of `fsync` is called `osync` and it's a system call that guarantees order and eventual durability. The dsync definition of `fsync` is called `dsync` and it's a system call that guaratess immediate durability (blocks). For more details, check the Optimistic Crash Cosnsistency paper linked above.
64
64
### Safety of the Script_Optfs ###
65
-
Optfs needs some improvements in cases of conditionals, as it is possible to compromise program correctness if an `fsync_wrapper` is called inside a conditional. Consider the following case:
65
+
The script is safe in most cases, but there certainly are cases we don't account for.
66
+
This script can deal with scope, so you can have functions with the same name in multiple files, as long as more than one of those functions doesn't have external linkage, our script will take care it. We went through great lengths to ensure that.
67
+
However, cases where a switch statement is used, like the following:
66
68
```C
67
-
voidfoo(x) {
68
-
bar1();
69
-
if (x == 0) {
70
-
bar1();
69
+
function foo(fd1, fd2, expression) {
70
+
switch (expression) {
71
+
case 1:
72
+
fsync(fd1);
73
+
break;
74
+
case 2:
75
+
fsync(fd2);
76
+
break;
77
+
default:
78
+
fsync(fd1);
79
+
fsync(fd2);
71
80
}
72
-
else {
73
-
bar1();
74
-
}
75
-
}
81
+
}
76
82
```
77
-
This would get converted to:
83
+
would get converted to the following:
78
84
```C
79
-
void osync_foo(x) { /* this osync definition is correct */
80
-
osync_bar1();
81
-
if (x == 0) {
82
-
osync_bar1();
85
+
function osync_foo(fd1, fd2, expression) { /* this definition is correct */
0 commit comments