English 中文(简体)
公开档案说明 洛克比混淆
原标题:Open File Description Locks confusion

http://www.gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html#Open-File-Description-Locks.html https://www.gnu.org/software/libc/manual/html_node/Open-File-Description-Locks.html#Open-File-Description-Locks

fcntl(F_OFD_SETLK) locks on an open file table entry, (usually obtained by open()). Easy to understand.

但以下例子:

在其示范程序中,每一条对口电话 open(),因此,每个档案管理员都应注明不同的公开档案表条目。

然后,每条路面的<代码>fcntl(fd, F_OFD_SETLKW, &lck)就在不同的公开档案表条目上打开了锁,这意味着这一锁定完全是错误的。

但我是在乌兰巴托测试的,出于某种原因。 我失踪了什么?

问题回答

旧问题但:多个文件descriptors可点到同一个公开档案description。 在此情况下,<代码>OFD式电话就说明本身(因此作为“LC”概念不可运输)而不是描述者建立了咨询锁。 微妙差异。





相关问题
Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Is reading from an XmlDocument object thread safe?

I was wondering if i could safely read from an XmlDocument object using SelectNodes() and SelectSingleNode() from multiple threads with no problems. MSDN says that they are not guaranteed to be ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签