RE: a basic ques regarding scheduling -- curiosity sake...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-
> bounce@xxxxxxxxxxxx] On Behalf Of Carlo Caione
> Sent: Thursday, October 07, 2010 2:55 PM
> To: nidhi mittal hada
> Cc: Kernelnewbies
> Subject: Re: a basic ques regarding scheduling -- curiosity sake...
> 
> 
> On Oct 7, 2010, at 11:06 AM, nidhi mittal hada wrote:
> 
> > A general question asking out of curiosity ...
> >
> > regarding scheduling in kernel
> >
> > if its a uniprocessor
> > and
> > i am playing two songs of 5 mins duration each in two separate
> music players
> > then
> > lets say cpu switches between these two processes ......
> >
> > first song1 is being played ..then song 1 is switched to ready
> queue from run queue ...
> > song2 is played then ..
> > then song1 will stop playing for that time period ...
> > and in that way
> > song1 shd take 10 mins (acc to my clock)
> > to complete
> > isnt it ....?

I am no Linux Kernel scheduling expert, but this is what I think-
On uniprocessor system how will cpu switch between the tasks? 
Unless there is external interrupt or one of the tasks goes to sleep or
wait for IO (disk access etc.). 
So task switch will be done during idle time of the task, so I don't
really think it will count to 10min.
And task switch is so quick looking at the processor speed (in your
example, you still hear sound of song-1 when processor already started
processing song2 :)).

> 
> I could be wrong (I'm guessing) but I think that a sort of buffering
> should be done in
> the hardware of the sound card so you can hear the sound even
> if the process is not providing data.
> 
> --
> Carlo Caione
> 

--
Thanks,
Nilesh




--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux