How to understand the first and second readers-writers problems? Posted: 31 Oct 2020 09:06 AM PDT Computer Systems: a Programmer's Perspective says The readers-writers problem has several variations, each based on the priori- ties of readers and writers. The first readers-writers problem, which favors readers, requires that no reader be kept waiting unless a writer has already been granted permission to use the object. In other words, no reader should wait simply because a writer is waiting. The second readers-writers problem, which favors writers, requires that once a writer is ready to write, it performs its write as soon as possible. Unlike the first problem, a reader that arrives after a writer must wait, even if the writer is also waiting. https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem says the first problem: no reader shall be kept waiting if the share is currently opened for reading. It prefers readers over writers, may starve writers in the queue the second problem: no writer, once waiting i.e. added to the queue, shall be kept waiting longer than necessary. It prefers writers over readers, may starve readers. Is it correct that: Regardless of which type of reader-writer problem, if there is reader(s) in critical region, a waiting reader can always enter the critical region, and a waiting writer can't, regardless of which one arrives earlier? Regardless of which type of reader-writer problem, if a writer is in critical region, no waiting reader or writer can enter the critical region? Is the first problem defined as: If no reader (regardless of whether a writer) is in critical region, a waiting reader shall have priority over a waiting writer, independently of which arrived earlier? Is the second problem defined as: If no reader (regardless of whether a writer) is in critical region, a waiting rwritr shall have priority over a waiting reader, independently of which arrived earlier? Thanks! submitted by /u/timlee126 [link] [comments] |
Could a third state in transistors used to delemit two bytes? Posted: 01 Nov 2020 05:08 AM PST For example, if we had the two bytes 11111111 and 00001111, they would be interpreted as 1111111100001111, right? Would it be possible to introduce a third state, which would be a delimiter? So 1111111100001111 would become 1111111121111, where 2 would be used to delimit the both. I am a noob and and just wondered if this were possible as that way more information could be transferred maybe (as the leading 0 wouldn't be "occupied")? submitted by /u/computer_man789 [link] [comments] |
No comments:
Post a Comment