User Mode Thread vs Kernel Mode Thread

User Mode Thread vs Kernel Mode Thread

Post by sjle » Wed, 20 Jul 2005 15:30:46


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
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by sjle » Wed, 20 Jul 2005 17:06:20

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




and

 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Arkady Fre » Wed, 20 Jul 2005 17:07:43

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
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by UGF2ZWwgQS » Wed, 20 Jul 2005 17:12:01

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
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Calvin Gua » Wed, 20 Jul 2005 17:15:47

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 (Windows DDK MVP)
Staff SW Engineer NetXtreme MINIPORT
Broadcom Corp. Irvine, CA
www.broadcom.com
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Arkady Fre » Wed, 20 Jul 2005 21:25:53

Are you sure ?

From :
http://www.yqcomputer.com/

"There's no single "scheduler" module or routine, howeverhe 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
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Calvin Gua » Thu, 21 Jul 2005 03:01:42

n 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.


"Arkady Frenkel" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...


 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Maxim S. S » Thu, 21 Jul 2005 09:28:58


Looks like your USB hardware design is broken.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
XXXX@XXXXX.COM
http://www.yqcomputer.com/
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by UGF2ZWwgQS » Thu, 21 Jul 2005 22:07:05


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
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by Maxim S. S » Fri, 22 Jul 2005 01:38:13


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 Shatskih, Windows DDK MVP
StorageCraft Corporation
XXXX@XXXXX.COM
http://www.yqcomputer.com/
 
 
 

User Mode Thread vs Kernel Mode Thread

Post by sjle » Sat, 23 Jul 2005 21:53:03

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




a