1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

writing a spooler

Discussion in 'Win32' started by ChristophKukulies, Oct 1, 2006.

  1. ChristophKukulies

    ChristophKukulies New Member

    Oct 1, 2006
    Likes Received:
    Trophy Points:
    I'm seeking for the following solution:

    Often it is desirable to queue requests from a client that registers (connects) with a server such that the request are served in a fifo manner, that is, requests should be executed in the same order as they come in.

    (Platform should be a windows NT/XP system) I'm not sure whether a solution on a file exchange basis would be appropriate, e.g. a service that looks into a certain directory and processes the files depending on their timestamp. Oldest file first. The file may contain all the processing information. The action of the service should be then to connect to a database and insert the data from the file.

    The other approach would be a server that waits for connections and processes them one after the other. In a polling loop that polls via select()
    on socket FDs, can I assure that I serve on a first in first out basis? I'd think so. Probably not if the server would open a thread for each connect. Then it would depend on the duration of the single thread when the transaction actually terminates.

    The polled method on the other hand has the disadvantage of possibly not being capable of coping with a high load of connection attempts.

    Any clues if there are solutions to this problem readily available?

    When databases are involved I could imagine that using a java server, servlets, rmi, jdbc or something in that vein would also be appropriate.

    It's just the order in the time axis that is concerning me.

    Discussion welcome.

Share This Page