# Errors in remote client reading of TTree from TFile via xrootd while simultaneously updating TTree on server

**URL:** <https://root-forum.cern.ch/t/errors-in-remote-client-reading-of-ttree-from-tfile-via-xrootd-while-simultaneously-updating-ttree-on-server/43479>\
**Category:** ROOT\
**Tags:** tree\
**Created:** [February 9, 2021, 10:39pm UTC](https://root-forum.cern.ch/t/errors-in-remote-client-reading-of-ttree-from-tfile-via-xrootd-while-simultaneously-updating-ttree-on-server/43479 "2021-02-09T22:39:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [February 10, 2021, 10:42pm UTC](https://root-forum.cern.ch/t/errors-in-remote-client-reading-of-ttree-from-tfile-via-xrootd-while-simultaneously-updating-ttree-on-server/43479/6 "2021-02-10T22:42:33Z")

</div>

Reading from a TFile is that is being written to is supported to some extent.

```auto
////////////////////////////////////////////////////////////////////////////////
/// Read the linked list of keys.
///
/// Every directory has a linked list (fKeys). This linked list has been
/// written on the file via WriteKeys as a single data record.
///
/// It is interesting to call this function in the following situation.
/// Assume another process1 is connecting this directory in Update mode
/// - Process1 is adding/updating objects in this directory
/// - You want to see the latest status from process1.
/// Example Process1:
/// ~~~{.cpp}
/// obj1.Write();
/// obj2.Write();
/// gDirectory->SaveSelf();
/// ~~~
///
/// Example Process2:
/// ~~~{.cpp}
/// gDirectory->ReadKeys();
/// obj1->Draw();
/// ~~~
/// This is an efficient way (without opening/closing files) to view
/// the latest updates of a file being modified by another process
/// as it is typically the case in a data acquisition system.

```

Now it is likely that this has not been stressed test where the writing frequency is high compared to the reading speed.

---

_[View the full topic](https://root-forum.cern.ch/t/errors-in-remote-client-reading-of-ttree-from-tfile-via-xrootd-while-simultaneously-updating-ttree-on-server/43479)._
