Multi threading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saravanakumar
    New Member
    • Sep 2006
    • 11

    Multi threading

    Hi,

    I am writing a program using multiple threads. I gave the time slice as 10 ms. I have created a thread named mythread. Sometimes mythread takes 20 or 30 ms for completting its execution. So mythread go to wait state after 10 ms, if any other process wait for execution. But i need to run mythread with out any breakage of execution. Is there any method to run mythread with out any interruption.

    Thanks in advance,
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    On what OS?

    Comment

    • saravanakumar
      New Member
      • Sep 2006
      • 11

      #3
      It is a RTOS named ETS.

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Most RTOS have a way of disabling the task sheduler temorarily so that no task switches take place. You can also disable interrupts if necessary.

        Comment

        • saravanakumar
          New Member
          • Sep 2006
          • 11

          #5
          Yes, I got the command for disble the scheduler.
          Thanks

          Comment

          • saravanakumar
            New Member
            • Sep 2006
            • 11

            #6
            Is there any WIN32 API commands present for disabling task scheduler?

            Comment

            • Banfa
              Recognized Expert Expert
              • Feb 2006
              • 9067

              #7
              Not that I am aware of but then it is slightly different from an embedded application.

              What you can do is with-in your application suspend the threads that you don't wish to run using ThreadSuspend (or is it SuspendThread?? )

              Comment

              • saravanakumar
                New Member
                • Sep 2006
                • 11

                #8
                I need to switch on a digital output for some interval(in milliseconds). The interval should be very accurate. I switched on the output and wait for sometime using Sleep() command then switch off the output. Its working fine with error of 200 micro seconds. But now i need sub-milliseconds, So i used some loops for giving delay instead of Sleep() command. The delay is varied time to time. I think this is due to interruption of other process. Now i tried with timer interrupts. But its hard to work with microseconds in timer interrupts.

                Comment

                Working...