472,958 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to form queues for data storage and how to Handle the matching of the Responses


Dear friends,

I am working on the problem which deals with the data management
of requests and how should we match the responses for the requests to
compare the correct Response.
my problem is like this, say I am intermediary node between "m"
and "n" nodes . n nodes send any of the "p"type of requests to any one
of the "m" nodes on the other side. I have to forward the requests to
one of the node in "m" nodes. The uniqueness of the request is that it
has specific unique resquest filed say "type of service"

I am thinking of maintaining " p" no .of queues for "n" nodes
seperately to send the request and store the requests information in my
intermediary device so that I can compare the responses easily i.e. I
will have to maintain the n*P queues but I want some simple
implementation for this problem. can any one help me out.
my another problem is that if I am maintaining a linked list data
structure for "P" types of requests for each of "n" nodes while I
forward the request I am facing a problem at the data storage of the
request. since after geeting the request from one side of the "n"
nodes. I am forming the structure as local variable to send the request
and storing it in the linked list but I doubt I will loose the data in
the linked list after existing from the function even though I store
the address of in the linked list. how to overcome the problem.

please can anyone specify me where I can get good inforamtion on
this kind of data storage and data matching in "C" implementation using
linux as platform and thread programming.

please help in this regard to solve the problem.

Thanking you all in advance,

Sulaiman

Nov 15 '05 #1
1 1378

"saleem" <su**************@gmail.com> wrote
my problem is like this, say I am intermediary node between "m"
and "n" nodes . n nodes send any of the "p"type of requests to any one
of the "m" nodes on the other side. I have to forward the requests to
one of the node in "m" nodes. The uniqueness of the request is that it
has specific unique resquest filed say "type of service"

I am thinking of maintaining " p" no .of queues for "n" nodes
seperately to send the request and store the requests information in my
intermediary device so that I can compare the responses easily i.e. I
will have to maintain the n*P queues but I want some simple
implementation for this problem. can any one help me out.
Have a queue for each of the "m" nodes, and keep all the information in your
structure.
If there are p types of messages, the natural structure would be a union,
with a single "type" member so you know what the type of a message is.
my another problem is that if I am maintaining a linked list data
structure for "P" types of requests for each of "n" nodes while I
forward the request I am facing a problem at the data storage of the
request. since after geeting the request from one side of the "n"
nodes. I am forming the structure as local variable to send the request
and storing it in the linked list but I doubt I will loose the data in
the linked list after existing from the function even though I store
the address of in the linked list. how to overcome the problem.

LInked lists are good for queues. if you free the data, you cannot then use
it, so use a temporary and call memcpy() to copy the contents to the
temporary. Then delete the node, pass the data in the temporary to your "m"
structures, and if necessary copy again into some permanent structure in the
"m" nodes.

Don't worry about the inefficiency, almost certainly it won't matter.
Programming clarity is what counts.
Nov 15 '05 #2

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

Similar topics

7
by: Anand Pillai | last post by:
The standard Python Queue module, allows to generate queues that have no size limit, by passing the size argument as <= 0. q = Queue(0) In a multithreaded application, these queues could be...
8
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member:...
4
by: Ice | last post by:
Hi there, I'm not sure if this is the right group for this- If it isn't, could anyone point me in the right direction? For our data structures exam, we are usually asked to implement the...
16
by: David Lauberts | last post by:
Hi Wonder if someone has some words of wisdom. I have a access 2002 form that contains 2 graph objects that overlay each other and would like to export them as a JPEG to use in a presentation....
2
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
1
by: lupo666 | last post by:
Hi, I have a database with only one table containing the following fields: ID (primary key, auto-counter), Client (Text), Internal_ID (Text), Window (Y/N), Lock(Y/N), LED (Y/N) What I'm...
5
by: Rachel Garrett | last post by:
If I created a Recordset in VBA, how do I make certain fields show up in a form?
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.