English 中文(简体)
在MacOSX,在C++方案中,我可以提供哪些保障。
原标题:On MacOSX, in a C++ program, what guarantees can I have on file IO

I am on MacOSX. I am writing a multi threaded program. One thread does logging. The non-logging threads may crash at any time.

我在记录中应该通过哪些公约,我能有什么保障?

我更希望找到解决办法,即使我在部分写字时坠毁,以前写的文字仍然 disk在软盘上,在读回记录时,我可以说出“ah,我写了100个完整包,然后我在第101次坠毁”。

感谢!

最佳回答

I program on conservation, not MacOSX, but may it s the same.

如果在你的节目记录中只读过一个字面,这意味着你要缓冲这一伐木线中的伐木数据,然后将其写成一个大片,以避免太多的I/O作业,并使伐木过程更快。

坏事是,如果一对.,整个过程就会与缓冲数据一起被销毁。

我知道,解决办法(针对六氯环己烷)是:

  1. 将伐木数据通过一个目录进行,而不使用缓冲砍伐线(syslog 。 在这种情况下,监督厅可能要注意数据,并填写在表上,即使申请坠毁,数据也应在另一端收到,并成功存档。

  2. 不管怎样,哪怕是使用伐木,每条透镜都可以同步地记录到档案中。 在这种情况下,坠毁后对原数据的损失应当非常小或根本没有。 速度缓慢。

我不知道解决这一问题的更好办法,但学习这些问题是令人感兴趣的。

问题回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签