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. Communication between Child and Parent Process
Forum Update on Monday, May 27th 2025

Communication between Child and Parent Process

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k 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.
  • W Offline
    W Offline
    walteste
    wrote on last edited by
    #1

    Hi,

    I would like to write a child and parent process, in which the parent process will start the child process. The main goal is that child an parent can communicate together, but I would prefer not using stdout/stderr to communicate.

    The communication is more in a way of request response and should be fast.

    Example:

    • Parent process starts child process
    • Parent process sends request to child process
    • Child process send response to parent process
    • Child process terminates

    What kind of implementation for this sort of communication method are you recommending?

    Regards,
    Stefan

    kshegunovK 1 Reply Last reply
    0
    • W walteste

      Hi,

      I would like to write a child and parent process, in which the parent process will start the child process. The main goal is that child an parent can communicate together, but I would prefer not using stdout/stderr to communicate.

      The communication is more in a way of request response and should be fast.

      Example:

      • Parent process starts child process
      • Parent process sends request to child process
      • Child process send response to parent process
      • Child process terminates

      What kind of implementation for this sort of communication method are you recommending?

      Regards,
      Stefan

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @walteste
      If you don't want to use the standard streams, and provided the parent and child processes are applications you're developing you have few other options. You could use d-bus if you're developing on Linux, or you could communicate through local sockets (my preferred solution).

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • W Offline
        W Offline
        walteste
        wrote on last edited by
        #3

        @kshegunov, are you refering to QLocalSocket class?
        I had a look at this as well and think that this is exactly what I am looking for.

        Do you have experience regarding performance of QLocalSocket?

        kshegunovK 1 Reply Last reply
        0
        • W walteste

          @kshegunov, are you refering to QLocalSocket class?
          I had a look at this as well and think that this is exactly what I am looking for.

          Do you have experience regarding performance of QLocalSocket?

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          @walteste

          are you refering to QLocalSocket class?

          Indeed, QLocalSocket and QLocalServer should suit you fine.

          Do you have experience regarding performance of QLocalSocket?

          If you're asking about speed, the local socket is very fast, although how fast exactly depends on the platform implementation. From my experience on Linux they're lightning fast (I believe shared memory mapping is used at the kernel level), on windows, not so much, but in any case it should be at least several times faster than reading/writing to HDD.

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0

          • Login

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