Esempio n. 1
0
        public bool Run()
        {
            Console.WriteLine("JAVA - DEOS\n");

            theTimer         = new NewTimer();
            thePeriodicClock = new PeriodicClock(Registry.uSecsInFastestPeriod);
            systemClock      = new Clock(thePeriodicClock, theTimer);

            DEOSKernel.ColdStartKernel();

            int result = DEOSKernel.CreateThreadK("user1", 0, 21, 1);

            logger.Info("{threadName}|{result}", "user1", result);

            result = DEOSKernel.CreateThreadK("user2", 0, 21, 1);
            logger.Info("{threadName}|{result}", "user2", result);

            int tickResult = Clock.NOINTERRUPTS;

            for (int i = 0; i < 1000; i++)
            {
                DEOS.println("****************************");
                DEOS.println("Current time: " + DEOS.systemClock.GetCurrentTime());

                DEOS.println(Scheduler.CurrentThread().ToString() + " is the current thread");

                tickResult = DEOS.systemClock.Ticks();

                Scheduler.CurrentThread().GetBody().Run(tickResult);
            }

            return(true);
        }
Esempio n. 2
0
        public Clock(PeriodicClock periodicIn, NewTimer timerIn)
        {
            if (DEOS.abstraction)
            {
                currentTime = -20;
            }
            else
            {
                currentTime = -1;
            }

            clockToNotify = periodicIn;
            timerToNotify = timerIn;
        }