fileio-synchronization.html
来自「有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等」· HTML 代码 · 共 265 行
HTML
265 行
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Synchronization</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="File System Support Infrastructure"HREF="fileio.html"><LINKREL="PREVIOUS"TITLE="Directories"HREF="fileio-directories.html"><LINKREL="NEXT"TITLE="Initialization and Mounting"HREF="fileio-mounting.html"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="fileio-directories.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="fileio-mounting.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="FILEIO-SYNCHRONIZATION">Chapter 24. Synchronization</H1><P>The FILEIO infrastructure provides a synchronization mechanism forcontrolling concurrent access to filesystems. This allows existingfilesystems to be ported to eCos, even if they do not have their ownsynchronization mechanisms. It also allows new filesystems to beimplemented easily without having to consider the synchronizationissues.</P><P>The infrastructure maintains a mutex for each entry in each ofthe main tables: filesystem table, mount table and file table. Foreach class of operation each of these mutexes may be locked before thecorresponding filesystem operation is invoked.</P><P>The synchronization protocol required by a filesystem is describedby the <TTCLASS="STRUCTFIELD"><I>syncmode</I></TT> field of the filesystemtable entry. This is a combination of the following flags:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="LITERAL">CYG_SYNCMODE_FILE_FILESYSTEM</TT></DT><DD><P>Lock the filesystem table entry mutexduring all filesystem level operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_FILE_MOUNTPOINT</TT></DT><DD><P>Lock the mount table entry mutexduring all filesystem level operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_IO_FILE</TT></DT><DD><P>Lock the file table entry mutex during allI/O operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_IO_FILESYSTEM</TT></DT><DD><P>Lock the filesystem table entry mutex during all I/O operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_IO_MOUNTPOINT</TT></DT><DD><P>Lock the mount table entry mutex during all I/O operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_SOCK_FILE</TT></DT><DD><P>Lock the file table entry mutex during all socket operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_SOCK_NETSTACK</TT></DT><DD><P>Lock the network stack table entry mutex during all socket operations.</P></DD><DT><TTCLASS="LITERAL">CYG_SYNCMODE_NONE</TT></DT><DD><P>Perform no locking at all during any operations.</P></DD></DL></DIV><P>The value of the <TTCLASS="STRUCTFIELD"><I>syncmode</I></TT> field in thefilesystem table entry will be copied by the infrastructure to theopen file object after a successful <TTCLASS="FUNCTION">open()</TT> operation.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="fileio-directories.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="fileio-mounting.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Directories</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="fileio.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Initialization and Mounting</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?