473,943 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scheduler in C

1 New Member
Can anyone help me in writing a scheduler in C ... here is the description of what i want :-


Description
Create a C program that simulates the scheduler component of an operating system. Your scheduler will be based upon a real-life situation. Select one of the following situations as the processing model for your simulated scheduler:
1. A line at the bank : This involves the use of a single queue but multiple tellers (processors).

Your program will simulate process flow through your model. Processes would enter at random intervals, but arrange your program so that part of your test run has many processes (busy time) and part has few processes (slow time).

While executing, your program should provide some form of displayed output. You can graphically represent what is happening, or continually update a chart or summary. When all of your processes have completed, your program should display a summary with the following information:
* Total number of processes
* Average wait time incurred by the processes
* Average total time for each process
Feb 25 '08 #1
2 2338
gpraghuram
1,275 Recognized Expert Top Contributor
Can anyone help me in writing a scheduler in C ... here is the description of what i want :-


Description
Create a C program that simulates the scheduler component of an operating system. Your scheduler will be based upon a real-life situation. Select one of the following situations as the processing model for your simulated scheduler:
1. A line at the bank : This involves the use of a single queue but multiple tellers (processors).

Your program will simulate process flow through your model. Processes would enter at random intervals, but arrange your program so that part of your test run has many processes (busy time) and part has few processes (slow time).

While executing, your program should provide some form of displayed output. You can graphically represent what is happening, or continually update a chart or summary. When all of your processes have completed, your program should display a summary with the following information:
* Total number of processes
* Average wait time incurred by the processes
* Average total time for each process

Please read the Posting Guidelines before doing any blind posting like this

Raghuram
Feb 25 '08 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
This can be done with linked lists.

First, you create a linked list of empty nodes. These will be used for tasks.
Second, create other lists for the priority of the tasks. Maybe 1,2,3,4,5,6,7,8 ,9.
Third, to schedule a task, move a node from the empty list to the end of desired queue.
Fourth, to compete a task, move the node back to the empty list.
Fifth, to re-prioritize a task, kisy move the node from one queue to another.
Sixth, when the empty list has no more nodes, your scheduler is full.
Good luck.
Feb 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
10628
by: keepyourstupidspam | last post by:
Anyone know of a reliable design for a Windows C++ Task Scheduler Class. The scheduler will expose a member function that will add schedules, its parameters will be an interval to run the tasks and a function pointer. This function pointer will be a void* function in other objects that will use the scheduler. So when another object calls the addSchedule function the scheduler will run these tasks at each interval provided. There may...
1
2953
by: Mike Thomas | last post by:
I want to start this thread again - on my first attempt I was a little ambiguous and was not able to get the answer I need. I am trying to start Access 2000 on Windows NT 2000 Server by using the scheduler with the command line: "c:\Program Files\Microsoft Office\Office\msaccess.exe" "d:\Apps\ChangeManagement.mdb" /x StartLoad This works when I run it from the "run" box, or via the scheduler when I am
1
1684
by: Neil Ginsberg | last post by:
I am having trouble using Windows Scheduler with an A2K database that has a password. The password is a db password, not a user-level security password. I have a routine I am looking for Scheduler to run, and, when the password is removed from the database, everything works fine. In that case, the command line I am having Scheduler use is: "C:\Program Files\Microsoft Office 2000\Office\MSACCESS.EXE" "C:\Mypath\MyDB.mdb" /x...
4
1908
by: LongBow | last post by:
Hello all, I have been working on my first embedded project which has been exciting and stressfull at the same time. My task now is to develop a good scheduler for transmitting ARINC labels. There is about 180 labels that go out over the bus. Each label has a transmission rate of 10 ms to 1000 ms or higher. I need to develop a good scheduler so that each label goes out at their respective transmission rate so they don't time out. I need...
7
15208
by: Shane Story | last post by:
Have an app and would like to allow easy addition of MYAPP.EXE /F /P (for example) my prog with command line args, as a job to be run. Would like to make it easier on the user to run the app. I want to have it run automatically as specified by the user. What is the best thing to do and what platforms would it limit me to?
8
3011
by: VMI | last post by:
I'm searching for a way to build a scheduler that will store its data in sql server. I've searched google but it mostly displays sites that sell scheduler controls. Anyone know of any sites that show more or less how to build a simple scheduler control? Thanks.
3
2252
by: mayur_hirpara | last post by:
Hi, I am writing a VB.NET application. It is a Windows application at the moment. The application contains a button. the click event of button perform a long running task. It needs to be started by windows task scheduler to carry out some operation. When I am testing the application I want to differentiate if the "differentiate between a program launched manually and launched by a
2
2266
by: yamca | last post by:
I want to write a task scheduler. But i cant make the logic between the scheduler and tasks. For example a have an external process which can add and delete tasks from scheduler. Every task has an id and number(Task1,Task2...). It will delete tasks by looking at their IDs. Scheduler complete the tasks and sets a flag=0, then ext process starts again. How can i store id,number,add/delete function and pass them t the scheduler?
4
2721
by: Sid Price | last post by:
Is there a .NET (2003) class available somewhere that might provide a comprehensive task scheduler with a better granularity than the one minute of the built-in scheduler on XP? Even down to 15 seconds would be better than one minute. Sid.
1
1912
by: =?Utf-8?B?YXVzdGlyb2I=?= | last post by:
Hi, While I realise that this may not be a very nice solution architecturally, I kick off a Scheduler in an ASP.NET 2.0 webservice in Application_Start() which is supposed to call a stored proc in a database once a day every day. The code works on the day that the webservice is deployed, but not on subsequent days unless I restart IIS. The code looks like this:
0
11538
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11133
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10666
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9866
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6311
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4515
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.