473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

duplex events

I need two classes that can signal each other. One class reads data and
signals the other when data is available. The other writes data to a buffer
then signals the other class to write it out.
I have seen a number of examples of events. I have seen none that goes both
ways.

Is this possible, and not overly complicated?

Thanks,
Bill
Nov 17 '05 #1
2 1251
first of all, in ya typical consumer and producer situition, i dont think
firing events between each other sounds like a better idea (IMO).

CLASSIC implementation is:
producer notify comsumer buffer ready
-------------> consumer do some magic (buffer locked, producer
automatically suspended awaiting for lock release)
--------------------------> consumer finishes (lock released)
-------------------------------------->producer automaticlly restarted

hope this helps
Nov 17 '05 #2
No not really. I'll be a bit more specific.

I have a thread running managing the serial port. I have another thread
running using the serial port thread.
When the serial port gets a specific number of bits it sets an event to let
the user thread know there is a data message in the buffer.
When the user thread wants to write data out the serial port it loads a
buffer with its data and sets an event to have the serial port write out the
data.

The reason for this is portability. I want do the same thing with ethernet
and usb.
The user thread works identically with thatever I/O port thread it is using.

I don't think this is a standard consumer-producer problem. But maybe I'm
wrong.

Thanks,
Bill



"Ashura" <As****@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
first of all, in ya typical consumer and producer situition, i dont think
firing events between each other sounds like a better idea (IMO).

CLASSIC implementation is:
producer notify comsumer buffer ready
-------------> consumer do some magic (buffer locked, producer
automatically suspended awaiting for lock release)
--------------------------> consumer finishes (lock released)
-------------------------------------->producer automaticlly restarted

hope this helps

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rjm | last post by:
I'm messing around with trying to record sound reflections off of various objects at different frequencies. I'm using python 2.4 on Fedora Core 3 and I have an SBLive card. Basically, I want to...
4
by: manofbluz | last post by:
I have two complex Word templates that also contain some Bookmarks for receiving database data dynamically. I'm using Word automation code within VB.NET to manipulate the template. I don't need to...
2
by: Matt Brandes | last post by:
Can anybody tell me how to tell what speed and duplex a machine is currently running at. It is very easy to find on a switch, however it is incredibly difficult if not impossible on the PC. For...
0
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and...
4
by: Jamey Shuemaker | last post by:
I've been looking for a way to do a duplex print job without a duplex printer. I reviewed some old posts about printing odd pages and found that most of them led to KB article 101075 or an export...
10
by: Joe M | last post by:
I was wondering if someone could lend me a hand with a C# problem I am having I am trying to use the “setPrinter” api to change the duplex setting (under printing preferences on printer...
2
by: =?Utf-8?B?SlA=?= | last post by:
Hi, We have an application that is written in Visual Studio .Net but the reports will not duplex while printing? Does anyone have an idea why? Thanks, -- JP
1
by: dotnetdummy | last post by:
Hi, Can anyone who can help me out if possible. At the moment, I'm working on a window application (vb.net) which print out html document's through a default network printer. I'm using...
0
by: Hans123 | last post by:
Hello, My goal is the properties settings of the default network printer by vba ( or vb code). In my case properties duplex/simplex. With the winspool.dll. This works fine if there the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.