Reader-Writer Application Project

  • Hi Leute,

    Ich habe die folgende requirements und ich soll dieses Project fertig machen. Kann jemand helfen mit dem Implementierung teil? Danke im voraus.


    The purpose of this project is to develop a multiple process application.

    Requirements

    Reader-Writer Application is defined as one main process, a number of reader processes and a number of writer processes. Note that the term “process” stands for an operating system process here, but not an operating system process thread.

    1. Main Process
    1.1. Opens/creates the shared log file, rwa-log.txt, in append mode
    1.2. Reads the configuration file, config.rwp to retrieve application parameters
    1.3. Creates and starts execution of a number of reader processes and a number of writer processes, as specified in the configuration file. Reader and writer processes will have their own code+data+stack spaces.
    1.4. Finally, waits on child exit for all reader and writer processes to terminate.

    2. Reader Processes
    2.1. Reader processes read the value of shared memory variable count and possibly write the value in log file.
    2.2. Since reading will be very fast in this project, time to process what has been read is simulated as random delay. Max delay is specified in the configuration file.
    2.3. Multiple readers can read concurrently and in a non-mutually exclusive manner.
    2.4. Reader processes execute in a loop for a specified time, as specified in the configuration file.
    2.5. Reader processes have priority over writer processes (Reader-Writer problem with reader priority).
    2.6. Log significant events in a shared log file.
    3. Writer Processes
    3.1. Writer processes read the value of shared memory variable count, randomly increment or decrement it by one, possibly write the value in log file, then write the value back to the shared memory variable count, all in a mutually exclusive manner.
    3.2. Since incrementing/ decrementing and writing will be very fast in this project, time to prepare for writing is simulated as random delay. Max delay is again specified in the configuration file.
    3.3. Writer processes write in a mutually exclusive manner. Reader processes and other writer processes are blocked if a writer process is writing.
    3.4. Writer processes execute in a loop for a specified time, as specified in the configuration file,
    3.5. Log significant events in a shared log file.
    4. Shared Memory Variable count
    4.1. Shared memory variable count is a 32 bit integer, initiaaly zero.
    5. Logging
    5.1. All critical actions of the main process and producer and consumer processes must be logged to the file rwa-log.txt, where log records are expected to be in date and time order.
    5.2. Log records are in the format
    yyyymmdd-hhmmss:sss dddd message
    where yyyymmdd is the date, hhmmss:sss is the time in milli seconds, dddd is the 4 digit pid of the process producing the log message and message is an explanatory text identifying the log action or significant event
    5.3. Example significant events are log open, main process start, configuration file values and their meanings, pid’s of reader and writer processes created by main, reader and writer process starts, values of shared memory variable count read or written, reader and writer process exits, etc.
    5.4. Since this is an application with no real user interface, checking log file is the only way to assure the application with concurrent processes is operating correctly, therefore you must be writing a rich set of log messages.
    5.5. There is no practical upper bound on the length of the log message or the number of log records in the log file (of course the logical disk size is the limit). What if an application cannot write to the log file?
    6. Environement
    6.1. Linux or Windows Environment
    6.2. C, C++ or C## programming language (No Java)
    6.3. Any development environment or framework

    If I was a Rich Girl.. See, I'd have all the money in the world, if I was a wealthy girl.....

  • Kommt darauf an. Hast du konkrete Fragen? Die werden hier vermutlich gerne beantwortet.

    Brauchst du wen, der die Aufgabe für dich bzw. mit dir erledigt? Das gehört dann wohl eher ins Nachhilfe-/Job-Forum. Siehe auch: http://www.informatik-forum.at/showthread.php…ll=1#post167379

    Yep. Ich habe die folgende Fragen.


    • Kann man dieses Aufgabe in c# machen?
    • Es gibt ein fork() method um c zu anwenden. Wie kann ich dieses fork() anzuwenden?
    • Ist dieses System Architektur richtig und genug? Welches System Architektur soll ich anwenden?


    [INDENT]informatik-forum.net/attachment/24251/

    und meine letzte frage ist über die Klassen Diagram. Was denkst du über dieses Diagram? Richtig or soll ich etwas addieren oder aendern?

    informatik-forum.net/attachment/24252/[/INDENT]

    If I was a Rich Girl.. See, I'd have all the money in the world, if I was a wealthy girl.....

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!