Exemple #1
0
        /**
         * <summary>
         * Exemple of a thread loading two file from disk
         * and print it
         * </summary>
         */
        public static void ThB()
        {
            AskResource TestPrinter = new AskResource();

            TestPrinter.AddResource(ram, 1);
            TestPrinter.AddResource(ram, 1);
            TestPrinter.AddResource(printer, 10);
            TestPrinter.Run();
        }
Exemple #2
0
        /**
         * <summary>
         * Exemple of a thread loading a file from disk,
         * then into the RAM and print it
         * </summary>
         */
        public static void ThA()
        {
            AskResource PrintJob = new AskResource();

            PrintJob.AddResource(disk, 2);
            PrintJob.AddResource(ram, 1);
            PrintJob.AddResource(printer, 8);
            PrintJob.Run();
        }
Exemple #3
0
        /**
         * <summary>
         * Exemple of a thread printing a big file from disk
         * </summary>
         */
        public static void ThC()
        {
            AskResource BigPrintJob = new AskResource();

            BigPrintJob.AddResource(disk, 15);
            BigPrintJob.AddResource(ram, 5);
            BigPrintJob.AddResource(ram, 1);
            BigPrintJob.AddResource(printer, 2);
            BigPrintJob.AddResource(ram, 1);
            BigPrintJob.AddResource(printer, 2);
            BigPrintJob.AddResource(ram, 1);
            BigPrintJob.AddResource(printer, 2);
            BigPrintJob.AddResource(ram, 1);
            BigPrintJob.AddResource(printer, 2);
            BigPrintJob.AddResource(ram, 1);
            BigPrintJob.AddResource(printer, 2);
            BigPrintJob.Run();
        }