Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
438 views

A toy example of the concurrent stack via atomic variables and CAS pattern

I've written a toy example of the concurrent stack which has only three functions push(), peek(), and ...
user37014's user avatar
1 vote
1 answer
1k views

Concurrent Queue with enqueue and dequeue using Stack as underlying data structure

This is a mix of data structure and multi threading concept based question. (This is only for understanding and learning purpose) The language for the solution : Java A Queue with FIFO behavior needs ...
Krishna Kumar's user avatar
5 votes
2 answers
2k views

Thread-safe stack in Java with fixed capacity

Implement a multi-threaded stack, with freedom to use existing implementations of stack. On top of being thread-safe, it must block (not busy-wait) a pushing thread when stack is full and a ...
user5447339's user avatar
5 votes
1 answer
175 views

Concurrent stack in C - follow-up

This is a follow-up question to Concurrent stack in C The pop function not just removes the top element from the stack, but also returns it. If a pthreads call ...
coderodde's user avatar
  • 29.8k
7 votes
2 answers
928 views

Concurrent stack in C

(See also the follow-up question.) I was in the mood for pthread.h and decided to write a concurrent stack data structure. My requirements: the stack has maximum ...
coderodde's user avatar
  • 29.8k
0 votes
2 answers
2k views

Custom concurrent stack implementation in Java

I don't want to use synchronized for sizeof method, any suggestion to implement the method thread safe? ...
ganesh r's user avatar
  • 185
4 votes
1 answer
183 views

Lock-free bounded stack atomics

I was thinking about using very basic bounded (preallocated) stack to keep track of my threads IDs in correct LIFO order. I was wondering if my implementation is thread safe: ...
inspirit's user avatar
  • 203
4 votes
1 answer
415 views

Multi producer/consumers lockfree stack

Can you please take a look at the following x86-64 C++ code which should implement a multi consumer/produce lockfree stack? Do you think I have missed anything? ...
Emanuele's user avatar
  • 240
3 votes
1 answer
334 views

Concurrent stack implementations in Ruby (relative performance of mutexes/CAS?)

This code is very simple, but it is intended as an experiment in the relative performance of mutexes/CAS on different platforms. The latest version can always be found at: https://github.com/...
Alex D's user avatar
  • 297