Skip to content

Instantly share code, notes, and snippets.

View mahadevshindhe's full-sized avatar
🏠
Working from home

mahadevshindhe

🏠
Working from home
View GitHub Profile
@mahadevshindhe
mahadevshindhe / CustomRentrantLock.java
Created November 9, 2021 08:56
Java Custom Re Entrant Lock implmentation
public class CustomRentrantLock {
public static void main(String[] args) {
LockCustom LockCustom=new ReentrantLockCustom();
MyRunnable myRunnable=new MyRunnable(LockCustom);
new Thread(myRunnable,"Thread-1").start();
new Thread(myRunnable,"Thread-2").start();
}
}
@mahadevshindhe
mahadevshindhe / Main.java
Last active November 9, 2021 08:18
Java custom thread pool implementation
public class Main {
public static void main(String[] args) {
ThreadPool pool = new ThreadPool(7);
for (int i = 0; i < 5; i++) {
Task task = new Task(i);
pool.execute(task);
}
}
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}