Thread.Sleep help

Aug 26, 2010 at 9:07 AM

im trying to make an animation so i need to have pauses between the frames and i know thread.sleep is unreliable or inacurat or whatever so is there a way i can have the thread sleep for a specified time without thread.sleep

Coordinator
Aug 26, 2010 at 9:14 AM
Please provide some info on what version of cosmos you are using..


On Thu, Aug 26, 2010 at 11:07 AM, xdalutzx <notifications@codeplex.com> wrote:

From: xdalutzx

im trying to make an animation so i need to have pauses between the frames and i know thread.sleep is unreliable or inacurat or whatever so is there a way i can have the thread sleep for a specified time without thread.sleep

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 26, 2010 at 9:43 AM

currently express ms4 but i can switch to ms5 when it is avaiable for the express edition

Coordinator
Aug 26, 2010 at 9:44 AM
thread.sleep is not implemented i think. What you could do is this (i know, ugly hack):

for(int i = 0; i < 1000000;i++){
 ; ; ; ;
}
and see if this stalls the CPU long enough. if not, you can make variations of that and see if it works.. :)


On Thu, Aug 26, 2010 at 11:43 AM, xdalutzx <notifications@codeplex.com> wrote:

From: xdalutzx

currently express ms4 but i can switch to ms5 when it is avaiable for the express edition

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Aug 26, 2010 at 9:52 AM

sleep is implemented but i cant get it to return in less than like 50 miliseconds which is really anoyying when u want the program to have done like 20 thingsbut its still sleeping. as for ur hack i would just rather not... lol id prefer a slow animation over a cpu stall. btw if u can get spinwait implemented thad be great but since its one of those things like 1 in a billion times its the answer a different solution would probly be best.

Coordinator
Aug 27, 2010 at 12:24 PM

I'm currently working on redoing sleep properly for the next release as the ATA code needs it. Its not a trivial task however.

Aug 30, 2010 at 12:03 PM

Use Cosmos.Hardware.PIT.Wait(ms)

Aug 30, 2010 at 10:18 PM

that doesnt seem to make a difference

Developer
Aug 31, 2010 at 12:59 PM

I added the following, tweak the numbers a little bit:

public static void Init()
        {
            var xBoot = new Cosmos.Sys.Boot();
            xBoot.Execute();
            Console.WriteLine("Hello World!");
            Cosmos.Hardware.PIT.Wait(500000);
            Console.WriteLine("Hello World Again!");
            while (true)
                ;
        }

Note that 50000 doesn't produce a very long wait.

Coordinator
Aug 31, 2010 at 1:08 PM

In your release, what unit is the argument to wait?

Developer
Aug 31, 2010 at 2:30 PM

Forgot the release :(

Excerpt from Wait()

RegisterTimer(new PITTimer(SignalWait, (int)(TimeoutMS * 1000000), false));
I'd guess milliseconds from that, maybe microseconds.

Coordinator
Aug 31, 2010 at 2:53 PM

Its probably just not working well. Now that I've fixed the x08 issue that cost me a week, Ill be redoing the PIT, RTC and sleep properly soon. I have to fix textmode in the dev kit which is broken.. but shouldnt take long...

Developer
Aug 31, 2010 at 2:56 PM

I'm using 57258... old revision... :)

Isn't that the last one to work with Express? I need to get Visual Studio from Dreamspark.

Coordinator
Aug 31, 2010 at 3:02 PM

The current dev kit ALMOST works with express... there is just one bug left regarding assembly resolution after loading the project... we really could use someone to fix it because Matthijs is back to school now and Im tied up on other things....

Developer
Aug 31, 2010 at 3:05 PM

I'll help if you want.

Coordinator
Aug 31, 2010 at 3:11 PM

Join us on IRC and Ill get you started...