Git Product home page Git Product logo

hust-operatingsystem's Introduction

HUST-OperatingSystem

2017 fall, codes about Operating System.

Experiment 1

编写程序,演示多进程并发执行和进程软中断、管道通信。
  • 父进程使用系统调用pipe( )建立一个管道,然后使用系统调用fork()创建两个子进程,子进程1和子进程2;
  • 子进程1每隔1秒通过管道向子进程2发送数据:
    I send you x times. (x初值为1,每次发送后做加一操作)
    子进程2从管道读出信息,并显示在屏幕上。
  • 父进程用系统调用signal()捕捉来自键盘的中断信号(即按Ctrl+C键);当捕捉到中断信号后,父进程用系统调用Kill()向两个子进程发出信号,子进程捕捉到信号后分别输出下列信息后终止:
    Child Process l is Killed by Parent!
    Child Process 2 is Killed by Parent!
  • 父进程等待两个子进程终止后,释放管道并输出如下的信息后终止:
    Parent Process is Killed!

Experiment 2

通过Linux多线程与信号灯机制,设计并实现计算机线程与I/O线程共享缓冲区的同步与通信。
  • 程序要求:两个线程,共享公共变量a
    • 线程1负责计算(1到100的累加,每次加一个数)
    • 线程2负责打印(输出累加的中间结果)

Experiment 3

利用多个共享内存(有限空间)构成的环形缓冲,将源文件复制到目标文件,实现两个进程的誊抄。

Experiment 4

编程实现目录查询功能:
  • 功能类似ls -lR
  • 查询指定目录下的文件及子目录信息;
    显示文件的类型、大小、时间等信息;
  • 递归显示子目录中的所有文件信息。

hust-operatingsystem's People

Contributors

swang-hust avatar

Stargazers

Eason Wang avatar Noaki avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.