User Mode Thread vs Kernel Mode Thread

Discussion in 'Windows Vista Drivers' started by sjlee, Jul 19, 2005.

  1. sjlee

    sjlee Guest

    Hello,

    I made an application which keeps polling USB received data.
    It works well except when explorer executes Macromedia flash.
    And better performace PC has little effects.

    I've checked the reason and found that it comes from the fact
    that internet explorer runs with "HIGH_PRIORITY_CLASS" priority,
    and (I think) its child activeX components(e.g. Macromedia flash)
    run with same priority.
    =====
    First question:
    Can I lower the priority of Macromedia flash?
    (I already know it is possible to disable running of Macromedia flash)
    =====
    I could not find solution to lower the priority of Macromedia flash.
    It's possible to raise the priority of my application, but it stops all
    other programs.

    Finally I decided that the user mode thread should be changed to
    a kenel mode thread. If it will be a kernel mode thread, I think it will
    run independant of all user mode applications.

    ======
    Second question:
    But, I'm not sure whether it will be so.
    ======

    Your answer will be greatly appreciated.

    Regards
    SJLEE
     
    sjlee, Jul 19, 2005
    #1
    1. Advertisements

  2. sjlee

    sjlee Guest

    Hello, Arkady

    Thank you for your help.

    I understand your answer is "try to inject customized code to lower the
    priority of Macromedia flash into explorer process".

    Is my understanding correct?

    When I lowered the priority of explorer, I checked explorer does not work
    well.

    Macromedia flash is one of ActiveX components which explorer executes.

    How can I get the thread ID of Macromedia flash to control the priority?

    I'm sorry for my poor english.

    Thank you in advance.

    Regards
    SJLEE
     
    sjlee, Jul 19, 2005
    #2
    1. Advertisements

  3. Dispatcher(scheduler) have no knowledge is it kernel or user mode thread and
    interested in priority of it in its scheduling policy.
    Try to inject ( with SetWindowsHook(Ex) e.g. ) you code inside and change
    priority with SetThreadPriority() there
    Arkady
     
    Arkady Frenkel, Jul 19, 2005
    #3
  4. sjlee

    Pavel A. Guest

    It liiks like the high priority threads in the flash plugin
    are associated with multimedia drivers ( wdmaud.drv, winmm.dll ).
    So, IE is not the culprit, any multimedia app would cause such effect.

    --PA
     
    Pavel A., Jul 19, 2005
    #4
  5. sjlee

    Calvin Guan Guest

    Well, scheduler and dispatcher are different beasts. To put it short:
    scheduler schedules which thread to run next while dispatcher dispatches the
    target thread to CPU(s) to execute.

    OP, if you have control over the driver, you can temporarily boost the RT
    priority level. See the second parameter of IoCompleteRequest.
     
    Calvin Guan, Jul 19, 2005
    #5
  6. Are you sure ?

    From :
    http://www.amazon.com/exec/obidos/t...f=sr_1_1/102-4893226-3344126?v=glance&s=books

    "There's no single "scheduler" module or routine, however—the code is spread
    throughout the kernel in which scheduling-related events occur. The routines
    that perform these duties are collectively called the kernel's dispatcher.
    Thread dispatching occurs at DPC/dispatch level and is triggered by any of
    the following events: ...."

    Arkady
     
    Arkady Frenkel, Jul 19, 2005
    #6
  7. sjlee

    Calvin Guan Guest

    In my opinion, scheduling is the collection of algorithms controlling how
    threads are managed/scheduled on a system but dispatching is the mechanism
    to make a ready thread run on CPU.

    Mixing them together isn't appropriate nor technically accurate. It sounds
    like "dispatcher schedules threads". Sounds weird to me.
     
    Calvin Guan, Jul 19, 2005
    #7
  8. Looks like your USB hardware design is broken.
     
    Maxim S. Shatskih, Jul 20, 2005
    #8
  9. sjlee

    Pavel A. Guest

    Why, Maxim? IMHO the OP raises a very interesting issue here -
    interference of high priority usermode tasks with real time
    driver tasks. It is pure driver design issue, nothing hardware.
    As driver activity tends to move from DPC to passive level, this becomes
    actual.

    Regards,
    --PA
     
    Pavel A., Jul 20, 2005
    #9
  10. He should use interrupt or isoch USB pipes, and design the hardware in a
    way so that the polling will be done by the HC hardware and not software.
     
    Maxim S. Shatskih, Jul 20, 2005
    #10
  11. sjlee

    sjlee Guest

    Maxim, thanks for your comment.

    After checking my hw, I agree with your thought.

    I used the usb serial converter for 2 PCs to communicate each other.
    The usb serial converter uses bulk pipes and my application is for real-time
    operation. That discrepancy would make my design so complex.

    So let me try to redesign using the host-to-host bridge which has a
    interrupt
    pipe.

    Have a nice day.

    Regards
    SJLEE
     
    sjlee, Jul 22, 2005
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.