semvec/pypi-packages huggingface dataset:
Cpu-scheduling-simulation 0.0.2
See live simulation of FCFS, SJF, Round Robin algorithms in CPU scheduling
License: MIT
Keywords: CPU Scheduling algorithms Simulation

# CPU Scheduling Simulation
  CPU use may algorithms such as 
  + First Come First Served(FCFS)
  + Shortest Job First(SJF)
  + Round robin

  These are used to schedule which process or task must be done **first** when many 
process are waiting. In this project I have created a simulation of these three algorithms to understand them more easier.

# Install with pip
 You can easily install this using pip,
```
pip install Cpu-scheduling-simulation
```
Then just import the package and run the functions named as algorithms to see the simulation in action
```python
import Cpu-scheduling-simulation as sim
sim.FCFS()
sim.SJF()
sim.Round_Robin()
```

# Packages used 
  **Pygame** a popular game library in pyton is used in this project to create simulation of the scheduling process

```
pip install pygame
```
You can also clone the repository and run the command to see the simulation in action 
```commandline
python3 FCFS.py
```

> Note: These simultaion can be used to understand CPU scheduling effectively, if you have basic knowledge of 
> CPU scheduling algorithms
oblif 0.3.1
Bytecode transformations to produce data-oblivious code
License: MIT
Requires Python: >=3.8

# oblif

[![Documentation Status](https://readthedocs.org/projects/oblif/badge/?version=latest)](http://oblif.readthedocs.io/?badge=latest)

See documentation [here](https://oblif.readthedocs.io/en/latest/)!

Oblif is a library that lets you write data-oblivious code in a non-data-oblivious way. For example:

```python
from mpyc.runtime import mpc

def test(x):
    return 1 if x==5 else 0

mpc.run(mpc.start())
print("test(5) is", mpc.run(mpc.output(test(type(5)))))
mpc.run(mpc.shutdown())
```

```
2021-05-08 13:56:22,858 Start MPyC runtime v0.7.4
Traceback (most recent call last):
    File "test-mpyc.py", line 14, in <module>
    print("test(5) is", mpc.run(mpc.output(test(type(5)))))
  File "test-mpyc.py", line 6, in test
    return 1 if x==5 else 0
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/mpyc-0.7.4-py3.8.egg/mpyc/sectypes.py", line 50, in __bool__
TypeError: cannot use secure type in Boolean expressions
```

But

```python
from mpyc.runtime import mpc
from oblif.decorator import oblif

@oblif
def test(x):
    return 1 if x==5 else 0

mpc.run(mpc.start())
type=mpc.SecInt()
type.ifelse = lambda self, ifval, elseval: ifval if ifval is elseval else mpc.if_else(self, ifval, elseval)
type.__deepcopy__ = lambda self, memo: self

print("test(5) is", mpc.run(mpc.output(test(type(5)))))

mpc.run(mpc.shutdown())
```

gives

```
2021-05-08 13:58:47,387 Start MPyC runtime v0.7.4
test(5) is 1
2021-05-08 13:58:47,394 Stop MPyC runtime -- elapsed time: 0:00:00.006167
```