登录 注册
当前位置:主页 > 资源下载 > 10 > 操作系统作业含括了生产者消费者问题的源代码

操作系统作业含括了生产者消费者问题的源代码

  • 更新:2024-09-29 11:41:38
  • 大小:251KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Java - 课程资源
  • 格式:DOC

资源介绍

操作系统生产者消费者源代码 四 程序的主要代码 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");