GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - moocf/array-queue.java: Array queue is a bounded lock-based FIFO queue using an array. It uses 2 separate locks for head and tail.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
ArrayQueue.java
ArrayQueue.java
 
 
LICENSE
LICENSE
 
 
Main.java
Main.java
 
 
README.md
README.md
 
 

Repository files navigation

Array queue is a bounded lock-based FIFO queue using an array. It uses 2 separate locks for head and tail.

Course: Concurrent Data Structures, Monsoon 2020
Taught by: Prof. Govindarajulu Regeti

enq():
1. Lock tail.
2. Try enq.
3. Unlock tail.
deq():
1. Lock head.
2. Try deq.
3. Unlock head.
tryEnq():
1. Ensure queue is not full
2. Save data at tail.
3. Increment tail.
tryDeq():
1. Ensure queue is not empty.
2. Return data at head.
3. Increment head.
## OUTPUT
Starting 10 threads with sequential queue
2: failed enq
5: failed deq
6: failed deq
7: failed deq
8: failed deq
1: failed deq
4: failed deq
9: failed deq
1: dequeued 0/1000 values
2: dequeued 0/1000 values
4: dequeued 0/1000 values
5: dequeued 698/1000 values
6: dequeued 0/1000 values
7: dequeued 0/1000 values
8: dequeued 0/1000 values
9: dequeued 0/1000 values
Was LIFO? false

Starting 10 threads with array queue
Was LIFO? true

See ArrayQueue.java for code, Main.java for test, and repl.it for output.

references

  • The Art of Multiprocessor Programming :: Maurice Herlihy, Nir Shavit

About

Array queue is a bounded lock-based FIFO queue using an array. It uses 2 separate locks for head and tail.

repl.it/@wolfram77/array-queue#README.md

Topics

arrayboundedconcurrentdatafifoheadjavalocksqueuestructurestail

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.