
#13452: Lock .tix file -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Code Coverage | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Indeed file locking is non-trivial, as our experiences with #13194 has taught us. If HPC records were written by Haskell code then we could simply piggy-back on the file locking interfaces in `base`. However, this isn't the case; `tix` files are written by the RTS. One option would be to change this, implementing the tix I/O bits in Haskell. Another would be to introduce file locking logic into the RTS. Regardless of how the locking itself will be implemented, the real question is how contention will be dealt with without either losing samples from one of the processes or causing one of the processes to block. It seems to me like this will likely require some refactoring of how TIX samples are read/accumulated/written; IIRC they are currently read by the RTS during startup, accumulated as the program runs, and written during shutdown. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13452#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler