Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OS Threads Scheduling

OS Threads Scheduling

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studioc++
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reza matinnejad
    wrote on last edited by
    #1

    I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005

    C P 2 Replies Last reply
    0
    • R reza matinnejad

      I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      I'm not sure I understand your question very well. What you would like to do is in fact that when you process a certain set of operations, disable thread switching (so that no other thread is processed until you have finished to process your set of operations). Is that what you want to do ? If yes, then I'm almost certain you can't do that. But there are other mean to achieve a similar result: if the only thing you want to do is to avoid that two threads of your program access the same 'resource' (whatever it might be) at the same time, then you can simply use a critical section to protect the access of said resource.

      Cédric Moonen Software developer
      Charting control [v1.3 - Updated]

      R 1 Reply Last reply
      0
      • C Cedric Moonen

        I'm not sure I understand your question very well. What you would like to do is in fact that when you process a certain set of operations, disable thread switching (so that no other thread is processed until you have finished to process your set of operations). Is that what you want to do ? If yes, then I'm almost certain you can't do that. But there are other mean to achieve a similar result: if the only thing you want to do is to avoid that two threads of your program access the same 'resource' (whatever it might be) at the same time, then you can simply use a critical section to protect the access of said resource.

        Cédric Moonen Software developer
        Charting control [v1.3 - Updated]

        R Offline
        R Offline
        reza matinnejad
        wrote on last edited by
        #3

        Actually i am working on my program performance. I want to know how much does it take to execute a set of operations in a thread, when 6 threads are running the same set of operations. I hace a timer for each thread, which starts at the beginning of these operations and stops at the end of these operations. but because of time slicing the timer value does not show the time executed by the same thread.

        1 Reply Last reply
        0
        • R reza matinnejad

          I want to enforce the OS, not to suspend a special thread during execution a set of operations, in a ,multithread program in c++.(all of my threads has the Realtime priority) OS: WinXP IDE: VS 2005

          P Offline
          P Offline
          pbraun
          wrote on last edited by
          #4

          You would need to add functionality to the operating system scheduler to accomplish this and since Microsoft operating systems are closed source, it is doubtful at best that you would be able to see and modify the source for your intended purpose. What is the reason that the thread operations are critical? Is it that they need to be executed in order? Do they need to be executed one right after another? If yes is the answer to either of the last two questions, then critical sections is the answer your looking for.

          Phil

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups