Hi all,

TBB is really brilliant. But, I'm not certain about somethings:

  1. Can TBB work in kernel mode? If I want to write codes for NIC driver in kernel mode, will it work? If yes, please tell me how to use it?
  2. Could anyone explain the following questions:
    1. If a process has 2 threads, how the 2 threads work in a 2-core processor?Do they work seperately on different cores until they finish their jobs? orthread 1 works on core1 for a momentwhile thread 2 workingon core 2, then thread 2 works on core 1 and thread 1 works on core 2? who schedules the working style?
    2. Just imagine that there is a processor with 1000 cores, then I issuse a process with 100 threads, how can I explicitly choose one core that is free to let one thread working on it andexit until its job finished(without intteruption by other threads)? That is: can programmers get fully control of each coreand set a explicit thread to work on it?

If any one knows the answer, pls give a detailed answer, with codes will be better. That's my appreciation!

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I'm happy about your enthusiasm for TBB. I fear you may run into lots of trouble trying to use it in kernel mode. One primary problem is that the TBB task scheduler is non-preemptive. It cannot interrupt a task if a higher priority task comes along. In fact, TBB has no notion of task priority beyond its location in the task tree. Tasks work until they are finished; they can hand the work off preferentially to other tasks and can arrange who gets the thread after they finish. All these represent unfair scheduling practices that would lead to load imbalances in a kernel but work well for preserving cache residence in a computational load.

For an explanation of processes and threads, you might take a look at this Wikipedia article.

Leave a Comment

Please sign in to add a comment. Not a member? Join today