… | |
… | |
1998 | There is no support for kqueue, as apparently it cannot be used to |
1998 | There is no support for kqueue, as apparently it cannot be used to |
1999 | implement this functionality, due to the requirement of having a file |
1999 | implement this functionality, due to the requirement of having a file |
2000 | descriptor open on the object at all times, and detecting renames, unlinks |
2000 | descriptor open on the object at all times, and detecting renames, unlinks |
2001 | etc. is difficult. |
2001 | etc. is difficult. |
2002 | |
2002 | |
|
|
2003 | =head3 C<stat ()> is a synchronous operation |
|
|
2004 | |
|
|
2005 | Libev doesn't normally do any kind of I/O itself, and so is not blocking |
|
|
2006 | the process. The exception are C<ev_stat> watchers - those call C<stat |
|
|
2007 | ()>, which is a synchronous operation. |
|
|
2008 | |
|
|
2009 | For local paths, this usually doesn't matter: unless the system is very |
|
|
2010 | busy or the intervals between stat's are large, a stat call will be fast, |
|
|
2011 | as the path data is suually in memory already (except when starting the |
|
|
2012 | watcher). |
|
|
2013 | |
|
|
2014 | For networked file systems, calling C<stat ()> can block an indefinite |
|
|
2015 | time due to network issues, and even under good conditions, a stat call |
|
|
2016 | often takes multiple milliseconds. |
|
|
2017 | |
|
|
2018 | Therefore, it is best to avoid using C<ev_stat> watchers on networked |
|
|
2019 | paths, although this is fully supported by libev. |
|
|
2020 | |
2003 | =head3 The special problem of stat time resolution |
2021 | =head3 The special problem of stat time resolution |
2004 | |
2022 | |
2005 | The C<stat ()> system call only supports full-second resolution portably, |
2023 | The C<stat ()> system call only supports full-second resolution portably, |
2006 | and even on systems where the resolution is higher, most file systems |
2024 | and even on systems where the resolution is higher, most file systems |
2007 | still only support whole seconds. |
2025 | still only support whole seconds. |