View Full Version : CPU burst time
hermit
08-21-2002, 05:42 AM
Im currently doing Operating system concepts. just a few concepts that i wanna debate on, and have a better understanding
What is your understading of CPU burst time. In process scheduling there is CPU BURST TIME! how can there be any burst time even before it is process? am i making sense? or rather burst time is just an assumption of how long a process would take? Which part of the operating system, predict the CPU burst time for process schedulling?
-hermit-
mithrandir
08-21-2002, 10:05 AM
The whole notion of process scheduling is the very basis for multitasking. Process execution consists of a cycle of CPU execution and I/O wait. Process execution starts off with a CPU burst. This is followed by what is known as an I/O burst, which is follwed by another CPU burst, then by an I/O burst, and so on and so forth.
There is no burst time for a process, before a process is started. That would be like ordering a cake for a birthday party, and not knowing how many people would be there - how could you be sure that there would be enough to go round (or too much)?
>>rather burst time is just an assumption of how long a process would take?<<
An I/O bound process would in reality have a very small burst time, however, a CPU bound process would have a long burst time. So, to a degree it is an assumption based upon the type of process.
Check out the book "Operating Systems Concepts" by Silberchatz and Galvin - they have an excellent chapter on CPU scheduling.
hermit
08-23-2002, 06:51 AM
Thanking you for that steath.
Anyway im required to do write a bash shell in UNIX. and i have no idea how to implement it . .
TROUBLE
what about the 3 algorithms of process sync? we dont actually implement it , in real life do we? those algoritms are for process sync without OS and hardware . . . im so lost, u cant believe it
face_master
08-23-2002, 06:57 AM
Yay! Pure Aussie thread!
hermit
08-23-2002, 07:03 AM
Hahha go MAGPIES!
mithrandir
08-23-2002, 07:03 AM
>>Anyway im required to do write a bash shell in UNIX. and i have no idea how to implement it . .<<
Did you perhaps mean you have to write a bash shell script? Why would they make you write a shell?
>>what at about the 3 algorithms of process sync? we dont actually implement it , in real life do we? those algoritms are for process sync without OS and hardware . . . im so lost, u can believe it<<
We used a language called BACI and wrote programs to simulate process synchronisation. It was pretty easy.
edit...UP THE MIGHTY LIONS!
hermit
08-23-2002, 07:06 AM
yeah bash shell script it is . .
the problem is, we are studying all these theories at uni, and all the sudden im required to do programming and write scripts . .
just tough , i mean for me
-hermit-
face_master
08-23-2002, 07:06 AM
GO THE DRAGONS! (right sport?)
//EDIT: i'm talking bout leage
hermit
08-23-2002, 07:09 AM
GET SOME AUSSIE SPIRIT IN HERE
AUSSIE AUSSIE AUSSIE OI OI OI . .
face_master
08-23-2002, 07:10 AM
AUSSIE AUSSIE AUSSIE !! ...
Originally posted by hermit
what about the 3 algorithms of process sync? we dont actually implement it , in real life do we? those algoritms are for process sync without OS and hardware . . . im so lost, u can believe it
Process sync is part of any OS, but you'll find that the algorithms that you're probably studying are either outdated, or most times, just theory. There has to be some kind of syncronization, otherwise efficiency would suck... err... in so many words.
Which algorithms are you talking about? I just took a course in Op Sys Concepts 2 months ago... I think there were more than 3, if I remember correctly.
Also, I too had to write a shell for Unix... I got the basics down... running programs with options and such, but I never got redirection working. The basic functionality is there, however. OH, I even got background processes to run too ;)
If you want to see what I did, let me know... I'll try to post the C code tonite when I get home.
face_master
08-23-2002, 07:12 AM
Damn you Ober!! DAMN YOU!! You ruined the only Aussie (hence the best :D) thread on this board!! DAMN YOU!!
oh, you just have to write a script??!?! That's easy! I could send you an example of one of those too ;)
Originally posted by face_master
Damn you Ober!! DAMN YOU!! You ruined the only Aussie (hen best :D) thread on this board!! DAMN YOU!!
ehh... just tryin to be helpful :D
face_master
08-23-2002, 07:18 AM
DAAAAAAAAAAAMN YOOOOOOU OBER!!!
*starts sobbing*
mithrandir
08-23-2002, 07:20 AM
If you want a very quick intro into shell scripts try this http://pegasus.rutgers.edu/~elflord/unix/bash-tute.html
Also if you want to learn more about bash in general - http://www.gnu.org/manual/bash-2.05a/html_node/bashref_toc.html
hermit
08-23-2002, 07:44 PM
just cant believe how good this forum is.
Thanking you so much . . i'll have a look and pick out the relevant information. if i need more help, i'll definitely ask
hermit
08-23-2002, 07:54 PM
ober5861: even though u spoiled our aussie thread, i have to thank you for trying to help.
anytime Hermit, anytime :)
hermit
08-30-2002, 07:28 PM
Okay i got abit confused. I am suppose to write a program that act like shell in C
I need to use fork, strtok, wait, execvp, how am i going to implement that?
fork will create a parent and child process, correct me if i am wrong. I understand the logic, but how do i code it
PM me... I'll check my code when I get home...
Have you ever used fork before? Basically, fork creates a child process and returns to PIDs... which you can use to run certain parts of your program... I can't remember which is which... but I think one returns 0 or 1 and the other returns a random number... I'll post some code later... it's really not that hard.
Hammer
09-02-2002, 08:12 PM
Basic fork example (code is in no way complete):
pid_t pid;
switch (pid = fork())
{
case -1:
perror("fork failed");
return (EXIT_FAILURE);
break;
case 0:
/*
* We're in the child, do whatever
*/
break;
default:
/*
* We're in the parent, do whatever
*/
break;
}
There are pleny of complete examples around.
here's my shell I wrote... I called it "obesh"... obe... shell? ;)
hermit
09-05-2002, 09:37 PM
thanking you for that oberrr
Govtcheez
09-06-2002, 10:16 AM
Yes, and I'd like to thank you too, ober - I've got that class next term :D
yeah... well it's not completely working... tho what I did have working got me like 34 out of 40 points... :)
face_master
09-07-2002, 08:52 AM
it was one good aussie thread we had there...
yeah... and I ruined it... whatcha gonna do about it? :)
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.