Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QFile ReadOnly is thread safe?
Forum Update on Monday, May 27th 2025

[Solved] QFile ReadOnly is thread safe?

Scheduled Pinned Locked Moved Solved General and Desktop
threadingqfile
3 Posts 2 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VRonin
    wrote on 26 Oct 2015, 09:57 last edited by VRonin
    #1

    Is accessing a file using QFile opened with ReadOnly flag, seeking it and use a QDataStream to read it from multiple threads safe?

    The file will be the same but using multiple instances of QFile to read it

    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
    ~Napoleon Bonaparte

    On a crusade to banish setIndexWidget() from the holy land of Qt

    1 Reply Last reply
    1
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Oct 2015, 10:14 last edited by
      #2

      Hi,

      If each thread has its own instance of QFile opened read-only and also its own QDataStream and does the processing itself, then no, there's no particular problem.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • V Offline
        V Offline
        VRonin
        wrote on 26 Oct 2015, 11:30 last edited by
        #3

        Thank you very much

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        1

        1/3

        26 Oct 2015, 09:57

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved