diff --git a/doc/changes/inotify.txt b/doc/changes/inotify.txt
new file mode 100644
index 0000000000..85a5aa4349
--- /dev/null
+++ b/doc/changes/inotify.txt
@@ -0,0 +1,44 @@
+2010-05-28
+
+Using asynchronous file modification (using inotify) instead of timestamp
+checking.
+
+- all files (usually only IOdictionary) that need to be monitored
+should be registered using MUST_READ_IF_MODIFIED. The MUST_READ should
+be used for objects that do not need to be re-read (e.g. fields).
+In the old system it would actually monitor e.g. 0/U and constant/polyMesh
+files.
+I've temporarily added a warning in IOdictionary if constructed with MUST_READ.
+Same for IOList,IOField,IOMap if constructed with MUST_READ_IF_MODIFIED
+(or is rereading supported?). Please let me know if something does not work or
+you see this warning.
+
+- all file monitoring is done by an instance of 'fileMonitor' in the Time
+class. The fileMonitor class can be found in OSspecific. Default is
+to use the (linux-specific) 'inotify' system calls.
+If compiled with -DFOAM_USE_STAT it will revert to the current 'stat' system
+calls.
+
+- inotify does not need timestamps. There is no need for fileModificationSkew
+to allow for time differences. (there can still temporarily be a difference
+in modified status between different processors due to nfs lagging)
+
+- all reductions to synchronise status on different processors are done with
+a single reduction instead of one reduction per registered object. This could
+be quite a gain on large numbers of processors.
+
+- fileMonitor stores two hashtables per file so there is a small overhead
+adding and removing files from monitoring.
+
+- if runTimeModifiable is false at start of run no files will get monitored,
+however if runTimeModified gets set to false during the run and monitored files
+will still get monitored (though never reloaded). This is only a hypothetical
+problem in that the kernel still stores events for the monitored files. However
+inotify is very efficient - e.g. it gets used to track changes on file systems
+for desktop search engines.
+
+- any monitored and modified file will get reloaded from the exact path
+that was monitored. In the old system it would/could do a re-search through all
+times.
+
+
diff --git a/src/OSspecific/POSIX/Make/files b/src/OSspecific/POSIX/Make/files
index f6e7c2d55e..788a08105a 100644
--- a/src/OSspecific/POSIX/Make/files
+++ b/src/OSspecific/POSIX/Make/files
@@ -9,6 +9,12 @@ POSIX.C
cpuTime/cpuTime.C
clockTime/clockTime.C
+/*
+ * Note: fileMonitor assumes inotify by default. Compile with -DFOAM_USE_STAT
+ * to use stat (=timestamps) instead of inotify
+ */
+fileMonitor.C
+
#ifdef SunOS64
dummyPrintStack.C
#else
diff --git a/src/OSspecific/POSIX/Make/options b/src/OSspecific/POSIX/Make/options
index e69de29bb2..b7e9d7211b 100644
--- a/src/OSspecific/POSIX/Make/options
+++ b/src/OSspecific/POSIX/Make/options
@@ -0,0 +1,3 @@
+#ifdef SunOS64
+EXE_INC = -DFOAM_USE_STAT
+#endif
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
new file mode 100644
index 0000000000..2103aa242d
--- /dev/null
+++ b/src/OSspecific/POSIX/fileMonitor.C
@@ -0,0 +1,372 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
+ \\/ M anipulation |
+-------------------------------------------------------------------------------
+License
+ This file is part of OpenFOAM.
+
+ OpenFOAM is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenFOAM. If not, see .
+
+Class
+ fileMonitor
+
+\*----------------------------------------------------------------------------*/
+
+#include "fileMonitor.H"
+#include "IOstreams.H"
+#include "Pstream.H"
+#include "PackedList.H"
+
+#ifdef FOAM_USE_STAT
+# include "OSspecific.H"
+# include "regIOobject.H" // for fileModificationSkew symbol
+#else
+# include
+# include
+# include
+#endif
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(Foam::fileMonitor, 0);
+
+template<>
+const char* Foam::NamedEnum::names[] =
+{
+ "unmodified",
+ "deleted",
+ "modified"
+};
+const Foam::NamedEnum
+ Foam::fileMonitor::fileStateNames_;
+
+
+namespace Foam
+{
+ class fileStateEqOp
+ {
+ public:
+ void operator()(unsigned int& x, const unsigned int& y) const
+ {
+ // x,y are list of 2bits representing fileState
+
+ unsigned int mask = 3u;
+ unsigned int shift = 0;
+ unsigned int result = 0;
+
+ while (mask)
+ {
+ // Combine state
+ unsigned int xState = (x & mask) >> shift;
+ unsigned int yState = (y & mask) >> shift;
+
+ // Combine and add to result. Combine is such that UNMODIFIED
+ // wins.
+ unsigned int state = min(xState, yState);
+ result |= (state << shift);
+
+ shift += 2;
+ mask <<= 2;
+ }
+ x = result;
+ }
+ };
+}
+
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+#ifdef FOAM_USE_STAT
+void Foam::fileMonitor::checkFiles() const
+{
+ for
+ (
+ HashTable