-
操作系统作业含括了生产者消费者问题的源代码
资源介绍
操作系统生产者消费者源代码
四 程序的主要代码
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.util.LinkedList;
public class myframe extends JFrame implements ActionListener{
JButton producer1,producer2,producer3,consumer1,consumer2,consumer3;
LinkedList blockProducerList=new LinkedList();
LinkedList blockCacheList=new LinkedList();
LinkedList blockConsumerList=new LinkedList();
JPanel blockCacheButtonList=new JPanel(new GridLayout(3,1));
JPanel blockProducerButtonList=new JPanel(new GridLayout(3,1));
JPanel blockConsumerButtonList=new JPanel(new GridLayout(3,1));
public myframe(){
JPanel MainPanel=new JPanel();
JPanel button=new JPanel(new FlowLayout());
consumer1=new JButton("消费者1");
consumer2=new JButton("消费者2");
- 上一篇: 操作系统课程设计(Nachos)
- 下一篇: Nachos操作系统课程设计教程