"The short way between two points,  it's right line"

Hi,
If you use MySQL for inter process communication you waste
performance.Benjamin is right.
You can use the classical forms of IPC or not.But the principle must remain
the same if you wish than your work that not to be in vain/for nothing.
A simple way can be, if you have a data structure which contain ,IP address
for incoming,IP for destination and a status flag.This struct you can use in
a array global variable which is attached to one segment of shared
memory(which is already created).
Scenario:
When one of users is "knocking" at your server:
    - take the message and "put it" in MySQL database(i suppose it's your
desire to use MySQL for exchange messages), because you don't know if the
"destination IP" user is connected or not(or you can make a routine to check
this ).
    -your global variable: IP_INCOMMING=164.0.0.1
                                     IP_OUTGOING = 164.0.0.2
                                     STATUS =(let's say) FOR_READ
   -if  "destination IP" is connected , he receive the signal "FOR_READ", in
this moment can read from MySQL the message and change the status to
"IS_READ".The "incoming IP" receive the signal and tell to the user which
send the message :"OK.Message was delivered".After this, a reset of both
location from array it's needed and status can be "WAIT_FOR_MESSAGES".
This is not an usualy way for inter process comunication, but it's fast.The
"child" process establish a way for communications directly with other
"child" process and not with "father" process.
It's seems to be very simple but you maybe already know, that "type" of work
have big advantage and some disadvantage.
This is my opinion and i hope to help you.

Regards,
Gelu


_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Philip Mak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 27, 2002 10:48 PM
Subject: Shared message queue?


> I have a bunch of processes running on the same machine that should be
> able to send unicast, multicast and broadcast messages to each other.
> Messages should be received in the same order that they were sent.
>
> I'm trying to figure out how to implement that. These processes are
> already sharing the same MySQL database, so I'm thinking that a
> process which wants to send a message could INSERT it into a table,
> then another process can SELECT it to read it. This would seem to
> require all processes to constantly poll the table, though, so I'm
> thinking maybe I should use something other than MySQL for the shared
> message queue functionality...
>
> Suggestions? Should I: (1) use MySQL as I described above, (2) use
> MySQL with some other method I haven't thought of, or (3) use
> something else?
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to