Sync Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danilo Rizzo

    #1

    Sync Access

    Hi,
    i should access to the same XML file from 3 application. I use
    System.Xml for load, save ecc ecc... so, i would access to file in
    synchronized mode and handling the queue.
    have you an idea?

    thk
  • Vadym Stetsyak

    #2
    Re: Sync Access

    You can use mutex to sync the access to Xml file.
    Mutex, if named, is globally visible. So, before doing any I/O to the
    ile - you will try to acquire that mutex.
    --
    Vadym Stetsyak aka Vadmyst
    Blog about software development, algorithms, network protocols, .NET, programming languages, tips & tricks, coding techniques and more.


    "Danilo Rizzo" <dani.rizzo@gma il.com> wrote in message
    news:eQ2uBHcJGH A.1180@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hi,
    > i should access to the same XML file from 3 application. I use System.Xml
    > for load, save ecc ecc... so, i would access to file in synchronized mode
    > and handling the queue.
    > have you an idea?
    >
    > thk[/color]


    Comment

    • Danilo Rizzo

      #3
      Re: Sync Access

      Vadym Stetsyak ha scritto:[color=blue]
      > You can use mutex to sync the access to Xml file.
      > Mutex, if named, is globally visible. So, before doing any I/O to the
      > ile - you will try to acquire that mutex.[/color]

      thanks, now i'm trying!

      Danilo

      Comment

      • Nick Hounsome

        #4
        Re: Sync Access

        mutex is only good for programs that are playing the same game.

        Would it be better to just keep a non-shared read/write stream open on the
        file - that would prevent any other app from writing or even moving it.

        "Vadym Stetsyak" <vadym_s@ukr.ne t> wrote in message
        news:eqjGDscJGH A.2036@TK2MSFTN GP14.phx.gbl...[color=blue]
        > You can use mutex to sync the access to Xml file.
        > Mutex, if named, is globally visible. So, before doing any I/O to the
        > le - you will try to acquire that mutex.
        > --
        > Vadym Stetsyak aka Vadmyst
        > http://vadmyst.blogspot.com
        >
        > "Danilo Rizzo" <dani.rizzo@gma il.com> wrote in message
        > news:eQ2uBHcJGH A.1180@TK2MSFTN GP09.phx.gbl...[color=green]
        >> Hi,
        >> i should access to the same XML file from 3 application. I use System.Xml
        >> for load, save ecc ecc... so, i would access to file in synchronized mode
        >> and handling the queue.
        >> have you an idea?
        >>
        >> thk[/color]
        >
        >[/color]


        Comment

        Working...