Solved

Simulation of an airport using Queues (C language)

Posted on 2008-10-19
4
3,396 Views
Last Modified: 2012-05-05
HI.
I need directions how to develop a code using C language (Queues) which simulate the operation of an airport. I have to create two queues (1 for landing and 1 for taking off), to give the frequency of landing and takeing off....
Anyway...
Do you have any idea how to do it

Thanks
0
Comment
Question by:tsakyr
4 Comments
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 22754815
Sounds like you need to create a FIFO linked list Q.  I guess you are restricted to C and an ansi compiler.  If so you'll have to write the linked list code.  Am I on the right track?
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 22754991
You would have a landing priority queue and a take off priority queue. In addition you would have an n number of runways that can be used for landing and take off.

You would take off one item from either landing or take off queue (depending on priority) and assign a runway to it. You must not have a runway assigned to more than one flight at a time. A single scheduler thread should be able to handle that. When a landing/take off has been completed, scheduler is indicated of the event and it schedules the next flight.

A thread per flight should make a reasonable simulation program.
0
 

Author Comment

by:tsakyr
ID: 22755423
thanks for help
0
 

Expert Comment

by:wolfmen
ID: 34291010
mee too
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
memory leak detection 9 94
Why this code doesn't work? 8 108
rhel6 C system() call to zip to archive has problems 25 245
Linux context switch  - loop takes long time to process 6 129
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question