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-stack.java: Array stack is a bounded lock-based stack using an array. It uses a common lock for both push and pop operations.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

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

Repository files navigation

Array stack is a bounded lock-based stack using an array. It uses a common lock for both push and pop operations.

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

push():
1. Lock stack.
2. Try push.
3. Unlock stack.
pop():
1. Lock stack.
2. Try pop.
3. Unlock stack.
tryPush():
1. Ensure stack is not full
2. Save data at top.
3. Increment top.
tryPop():
1. Ensure stack is not empty.
2. Decrement top.
3. Return data at top.
## OUTPUT
Starting 10 threads with sequential stack
7: failed pop
1: failed pop
5: failed pop
8: failed pop
9: failed pop
1: popped 0/1000 values
5: popped 158/1000 values
7: popped 0/1000 values
8: popped 0/1000 values
9: popped 31/1000 values
Was LIFO? false

Starting 10 threads with array stack
Was LIFO? true

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

references

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

About

Array stack is a bounded lock-based stack using an array. It uses a common lock for both push and pop operations.

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

Topics

arrayboundedcommonconcurrentdatajavalockstackstructures

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

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.