Skip to content

signalarun/thread-learnings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Thread-learnings

Information on threads

Java Snipets

  1. Runtime.getRuntime().availableProcessors();
  2. Cached thread pool
    These are used for IO intensive operations
      Runnable job = () -> {
        try{
          Thread.sleep(20);
        }catch(InterruptedException e){
          System.println(e.printStackTrace());
        }
        Sysem.out.println(Thread.currentThread().getName());
      }
      
      ExecutorService executor = Executors.newCachedThreadPool(); // creating cached threadpool
      
      for(int i=0; i<10; i++){
       executor.execute(job); // executing the job with cached threadpool
      }
      
    

Tutorials

  1. Executor Service - Pool Types
  2. Completable Future
  3. Ideal threadpool size
  4. https://mkyong.com/java/java-scheduledexecutorservice-examples/

Libraries

  1. https://projectreactor.io/

About

Information on threads

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published