使用信号量的读者/作家问题的解决方案,无论是读者还是作家都不会被优先考虑 [英] A solution to the Readers/Writers Problem using semaphores where neither readers nor writers would be preferred priority-wise

查看:190
本文介绍了使用信号量的读者/作家问题的解决方案,无论是读者还是作家都不会被优先考虑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设计一个读者-作家信号量解决方案,使读者和作家都不被优先考虑????我不知道它是否会导致饥饿问题????/

How to design a reader-writer semaphore solution where neither readers nor writers would be preferred priority wise????? I dont know if it causes a starvation problem????/

推荐答案

几年前,我在这样的系统上工作,如果我没记错的话,它会发生以下问题: :


  • 从数据缓冲区,循环数组,集合等的集合开始
  • 每个缓冲区具有以下四种状态之一:

    • 填充
    • 排水
I worked on a system like this some years ago and if I recall correctly it goes something like:


  • Start with a collection of data buffers, circular array, collection etc
  • Each buffer has one of four statuses:

    • Empty
    • Filling
    • Full
    • Draining


这篇关于使用信号量的读者/作家问题的解决方案,无论是读者还是作家都不会被优先考虑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆