Event between 2 processes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Priebe

    Event between 2 processes

    Hi,

    I need a possibility to fire an event in one process and react in another
    process.

    can anybody help me ?

    Martin


  • Neo Morpheous

    #2
    Re: Event between 2 processes

    Martin Priebe wrote:
    Hi,
    >
    I need a possibility to fire an event in one process and react in another
    process.
    >
    can anybody help me ?
    >
    Martin
    >
    >
    Depends on how low level you want to go. You can use any of the
    following (Generally falls under "InterProce ss communication" - you may
    want to Goggle that up:

    1). Named Pipes
    2). Shared memory (assuming both processes are on the same physical
    machine - otherwise it gets slightly more complicated)
    3). Windows (or another form of) messaging

    HTH

    Comment

    • Peter Duniho

      #3
      Re: Event between 2 processes

      On Wed, 02 Jul 2008 00:43:05 -0700, Martin Priebe
      <martin.priebe@ hermos.comwrote :
      I need a possibility to fire an event in one process and react in another
      process.
      >
      can anybody help me ?
      Chances are, yes.

      But your question is very vague. The basic requirement is that you will
      have to implement yourself some kind of inter-process communication. The
      C#/.NET event model doesn't support this implicitly. But once you have
      the IPC working, it should be simple enough to create an event in one
      process that is raised in response to communications received from another
      process.

      Pete

      Comment

      • Martin Priebe

        #4
        details

        okay ..

        i use shared memory to transfer a bitmap from one process to the second
        process.
        it works.

        but i have 2 problems.

        first:
        process one have to signalize "ready" - so process 2 can read out the shared
        memory.

        second:
        i need to signalize "ready" + meta-data. (length of the byte-array)
        when i use Win API CreateEvent and OpenEvent - it works.
        But i can´t transfer any information with it.

        greeting and thx
        Martin


        Comment

        • Neo Morpheous

          #5
          Re: details

          Martin Priebe wrote:
          okay ..
          >
          i use shared memory to transfer a bitmap from one process to the second
          process.
          it works.
          >
          but i have 2 problems.
          >
          first:
          process one have to signalize "ready" - so process 2 can read out the shared
          memory.
          >
          second:
          i need to signalize "ready" + meta-data. (length of the byte-array)
          when i use Win API CreateEvent and OpenEvent - it works.
          But i can´t transfer any information with it.
          >
          greeting and thx
          Martin
          >
          >
          Sounds like you would have been better of using Windows messaging, since
          that is more in line with the event-driven paradigm you appear to be
          describing. For windows messaging, (assuming you had client/server and
          not P2P model), you would create an invisble window in the client and
          you simply send the data to the client from the publisher, when the data
          is available. Small caveat, the size of the data payload is fixed (i.e.
          cannot be changed), so your best bet would be to specify the size of the
          largest image you expect to send, alternatively, you could incorporate
          meta data in the payload, which allows you to split it into several
          'packets' and then reassemble at the client side.

          With shmem (shared memory), you need to set aside a portion of the
          memory where your sender writes the status (ready, etc) as well as any
          metadata. The client will have to continously poll this section of shmem
          to see if data is available and act on that info.

          Comment

          • Martin Priebe

            #6
            Re: details

            Okay ... thx lot.

            the tip "to specify the size of the largest image you expect" is great.
            it works fine.
            (but it could be faster when i know the correct size of the array)

            if i use the event or windows messaging i don´t know yet.


            greeting Martin


            "Neo Morpheous" <bluebpill@ur sa-major.comschrie b im Newsbeitrag
            news:BZSdnbxR8u rs3fbVnZ2dnUVZ8 tSdnZ2d@bt.com. ..
            Martin Priebe wrote:
            >okay ..
            >>
            >i use shared memory to transfer a bitmap from one process to the second
            >process.
            >it works.
            >>
            >but i have 2 problems.
            >>
            >first:
            >process one have to signalize "ready" - so process 2 can read out the
            >shared memory.
            >>
            >second:
            >i need to signalize "ready" + meta-data. (length of the byte-array)
            >when i use Win API CreateEvent and OpenEvent - it works.
            >But i can´t transfer any information with it.
            >>
            >greeting and thx
            >Martin
            >
            Sounds like you would have been better of using Windows messaging, since
            that is more in line with the event-driven paradigm you appear to be
            describing. For windows messaging, (assuming you had client/server and not
            P2P model), you would create an invisble window in the client and you
            simply send the data to the client from the publisher, when the data is
            available. Small caveat, the size of the data payload is fixed (i.e.
            cannot be changed), so your best bet would be to specify the size of the
            largest image you expect to send, alternatively, you could incorporate
            meta data in the payload, which allows you to split it into several
            'packets' and then reassemble at the client side.
            >
            With shmem (shared memory), you need to set aside a portion of the memory
            where your sender writes the status (ready, etc) as well as any metadata.
            The client will have to continously poll this section of shmem to see if
            data is available and act on that info.

            Comment

            • Martin Priebe

              #7
              Re: details

              okay ..
              i send the size in the first 4 bytes.
              so i read the 1st 4 bytes and then read out the rest with this length

              thx
              Martin



              "Martin Priebe" <martin.priebe@ hermos.comschri eb im Newsbeitrag
              news:eyQ8PKC3IH A.3544@TK2MSFTN GP05.phx.gbl...
              Okay ... thx lot.
              >
              the tip "to specify the size of the largest image you expect" is great.
              it works fine.
              (but it could be faster when i know the correct size of the array)
              >
              if i use the event or windows messaging i don´t know yet.
              >
              >
              greeting Martin
              >
              >
              "Neo Morpheous" <bluebpill@ur sa-major.comschrie b im Newsbeitrag
              news:BZSdnbxR8u rs3fbVnZ2dnUVZ8 tSdnZ2d@bt.com. ..
              >Martin Priebe wrote:
              >>okay ..
              >>>
              >>i use shared memory to transfer a bitmap from one process to the second
              >>process.
              >>it works.
              >>>
              >>but i have 2 problems.
              >>>
              >>first:
              >>process one have to signalize "ready" - so process 2 can read out the
              >>shared memory.
              >>>
              >>second:
              >>i need to signalize "ready" + meta-data. (length of the byte-array)
              >>when i use Win API CreateEvent and OpenEvent - it works.
              >>But i can´t transfer any information with it.
              >>>
              >>greeting and thx
              >>Martin
              >>
              >Sounds like you would have been better of using Windows messaging, since
              >that is more in line with the event-driven paradigm you appear to be
              >describing. For windows messaging, (assuming you had client/server and
              >not P2P model), you would create an invisble window in the client and you
              >simply send the data to the client from the publisher, when the data is
              >available. Small caveat, the size of the data payload is fixed (i.e.
              >cannot be changed), so your best bet would be to specify the size of the
              >largest image you expect to send, alternatively, you could incorporate
              >meta data in the payload, which allows you to split it into several
              >'packets' and then reassemble at the client side.
              >>
              >With shmem (shared memory), you need to set aside a portion of the memory
              >where your sender writes the status (ready, etc) as well as any metadata.
              >The client will have to continously poll this section of shmem to see if
              >data is available and act on that info.
              >
              >

              Comment

              Working...