Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

overlapped vs nonoverlapped

Status
Not open for further replies.

alzomor

Advanced Member level 2
Advanced Member level 2
Joined
Jun 9, 2005
Messages
674
Helped
39
Reputation
78
Reaction score
8
Trophy points
1,298
Location
Germany
Activity points
6,406
serial port overlapped vs non overlapped

Hi

I am using the Serial port to read data from an external device.

I don't know when data arrives.

I need the read operation to continue even after recieving becuse the external device send data as bursts distrebuted in time

What's better for such operation
1-non overlapped operation
2-Multithreded nonoverlapped operation
3-Overlapped operation

Salam
Hossam Alzomor
www.i-g.org

Added after 1 minutes:

and why?
 

Hi~~

If you use an interrupt scheme, you donot need to know when the data has been arrived. The answer to your question depends on the situation of your application. Normally, when it is OK to run your program only to communicate through the serial port without doing anything, then, non-overlapped Operation is recommended. Otherwise, you will use overlapped operation.

Bye~~
 

Overlapped vs Non-Overlapped
When you use the serial port only to receive data, you will probably gain little by using overlapped operation. (You could use overlapped operation and mix the WaitForMultipleObjects with other operations from your application but this is generally a bad idea)
When you want to receive and transmit data and perhaps other serial port operations (DTR, ...) without knowing when either of them will happen in the same thread, then overlapped operation is very powerfull.

MultiThreaded vs SingleThreaded
When you want other operations in your application to happen asynchronously, perhaps a user-interface, then you should write it multithreaded.

So for an application that only receives bytes and logs them to a file (or prints them on the screen) a Non-Overlapped SingleThreaded application should be sufficient.

Regards
Antharax
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top