Programm-Synchronisation auf unterschiedlichen Rechnern



  • Guten Tag, ich habe auf zwei Rechnern zwei Programm laufen, die sich um eine Resource streiten.

    Würde ich die Programme auf einem Rechner laufen lassen, würde ich ein Mutex-Objekt zur Synchronisation verwenden.

    Was nehme ich, wenn die Programme auf unterschiedlichen Rechnern innerhalb eines Netzwerkes laufen?

    Besten Dank!



  • Da musst Du selbst was erfinden.
    Ich frage mich jedoch wozu Du das brauchst.
    Simon



  • simon.gysi schrieb:

    Da musst Du selbst was erfinden.
    Ich frage mich jedoch wozu Du das brauchst.
    Simon

    Von beiden Rechnern wird auf ein AS/400-Programm zugegriffen. Dieses Programm stürzt ab, wenn es gleichzeitig mehrfach aufgerufen wird. Warum weiß ich nicht, habe mit AS/400-Programmierung nichts zu tun. Der Entwickler dort hat wohl Probleme, das auf der AS/400 zu synchronisieren.

    Ich dachte mit .NET-Remoting könnte man so etwas machen?



  • Mit .NET Remoting geht das sicher.
    Oder auch mit DCOM. (Oder CORBA oder...). Ist aber vermutlich alles etwas Overkill.

    Eigentlich müsste es möglich sein ein File auf einer SMB Share zu verwenden. Einfach exklusiven Zugriff drauf holen. Wenns nicht ging in ein paar huntert ms wieder probieren.



  • http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx

    [MSDN]
    Semaphores are of two types: local semaphores and named system semaphores. If you create a Semaphore object using a constructor that accepts a name, it is associated with an operating-system semaphore of that name. Named system semaphores are visible throughout the operating system, and can be used to synchronize the activities of processes. You can create multiple Semaphore objects that represent the same named system semaphore, and you can use the OpenExisting method to open an existing named system semaphore.
    [/MSDN]



  • loks schrieb:

    http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx

    [MSDN]
    Semaphores are of two types: local semaphores and named system semaphores. If you create a Semaphore object using a constructor that accepts a name, it is associated with an operating-system semaphore of that name. Named system semaphores are visible throughout the operating system, and can be used to synchronize the activities of processes. You can create multiple Semaphore objects that represent the same named system semaphore, and you can use the OpenExisting method to open an existing named system semaphore.
    [/MSDN]

    Was willst Du damit sagen?
    Simon


Anmelden zum Antworten