Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An attempt to implements j.u.c whereby other alogrithms

NotificationsYou must be signed in to change notification settings

coderplay/concurrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

An attempt to implements j.u.c whereby other alogrithms

Getting Started

Pre-requirement

  • JDK 6 +

Installation

git clone https://github.com/coderplay/concurrent.gitmvn clean package

Examples

FastArrayBlockingQueue

finalintBUFFER_SIZE =1024 *8;finallongITERATIONS =1000L *1000L *10L;finalBlockingQueue<Long>queue =newFastArrayBlockingQueue<Long>(// producer strategynewSingleThreadedClaimStrategy(BUFFER_SIZE),// consumer strategynewSingleThreadedWaitStrategy());Runnableconsumer =newRunnable() {@Overridepublicvoidrun() {try {for (longl =0;l <ITERATIONS;l++)queue.take().longValue();        }catch (InterruptedExceptionie) {        }      }    };Runnableproducer =newRunnable() {@Overridepublicvoidrun() {try {for (longl =0;l <ITERATIONS;l++)queue.put(Long.valueOf(l));        }catch (InterruptedExceptionie) {        }      }    };newThread(consumer).start();newThread(producer).start();

About

An attempt to implements j.u.c whereby other alogrithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp