Assigning Thread Priority

  • Thread starter Thread starter mahesh.5683
  • Start date Start date
M

mahesh.5683

Hai everybody,

This is my application.

* My application concentrates mainly on serial communication. Mine is a
Windows CE device application. I've used System.IO.Ports class for
that.

* For transmitting data I've created a procedure and assigned a
priority for that, using thread.priority (So that i continuously
transmit data).

* For receiving the data I use Serialport_DataReceived event. Is there
any way that i can assign my own priority level for the
Serialport_DataReceived event.
 
There's no simple way to adjust the Rx priority because the Port class
creates it's own internal receiver thread. If you feel you really need it
(I'd need convincing) then probably the simples way is to just use the
OpenNETCF serial classes as then you have the source and can readily modify
the priority.

www.opennetcf.org/sdf

-Chris
 
Hi,

No. Why would you want to do so?

If there is a performance issue that you think this might affect (I doubt
there is anything you can do with priority that might be salutory), IMO, you
may have to look elsewhere.

While the Ports.IO class uses threading, it is via a delegate callback, for
which (AFAIK) the priority cannot be changed.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top