Whats the diffrence between Disk scheduling and process scheduling? I mean i know the roles of disks and processes, but it seems to me they both have the same aim. to reduce monopolies, they even both share similar algorithms like first come first serve. Am i right?
This is part of a bigger concept called "caching". When you run a program, we would like to have it in CPU registers because is the fastest memory, but that is very expensive, so the programs (processes) are sent to RAM (also we would like to run many processes, more than the registers may keep). RAM soon or later will be full, we need to keep more programs on memory, so the next caching level is send the processes that aren't being used from RAM to disk.
- The disk scheduling then consist in send to disk the processes that are not being used right now, but someday they will.
- The process scheduling allows you to use many programs and apps in a "paralell" way (you see that everything is executing at the same time, but is just an illusion).
In fact as you mention, some algorithms are used for both functions, and I think it's because in both case you have to decide what are you going to use and bring it.
So the goal is sightly different, but uses the same ideas.
Disk scheduling has an additional physical constraint. Accelerating and moving the disk head takes times in the msec range. Wikipedia says average seek times are around 10 msec (to move halfway across the radius of the disk) and the time to move just to the adjacent track is about .5 msec. Thus an algorithm like FIFO might be reasonable for process scheduling because it would deliver about the same compute throughput as any other scheduling algorithm, but FIFO would be a disaster for disk scheduling.
You are not correct that the primary objective of either disk scheduling or process scheduling is "to reduce monopolies". In real time process scheduling, for example, the primary objective is to make sure that processes with lower priority never run when there is a higher priority process available.
There are things that are worse than monopolies on workstations too. If you are time sharing between some number of processes that are consuming so much VM that you are thrashing then no-one is getting any service, and you are better off being less fair (swapping out processes until the ones that are left can get some CPU service and hopefully finish.)
Finally, most real operating systems try to give priority to "interactive" processes. But you can't figure out which processes are interactive until you've seen them running. So you use an algorithm like Corbato's Multi-level feedback queue.
Edit: I forgot to mention that disk scheduling algorithms are often variants of the elevator scheduling algorithm. This moves the disk head in one direction, doing requests in the order that they lie on the disk. The objective in the elevator algorithm is to maximize throughput while putting a bound on unfairness.