threads

Computer code on screens

Let’s find out the difference between Thread and Runnable

Reading Time: 2 minutes Multithreading is a process where we are uses multiple threads (threads are the sub-processes, they are lightweight and occupy less space) to perform various tasks simultaneously. Multithreading is used to achieve multitasking. There are two ways by which we can create threads in SCALA By extending the Thread class By extending the Runnable interface Now there is a question that what is the difference between Continue Reading

What is multi-threading?How to achieve multi-threading in java?

Reading Time: 3 minutes Multi threading  is a process of executing multiple threads simultaneously.Multi threading don’t allocate separate memory area so saves memory, and context-switching between the threads takes less time than process. Multi-threading is the idea of multitasking into applications where you can distribute specific operations within a single application into individual threads. Each of the threads can run in parallel. It performs multi activities concurrently. Multi Tasking Continue Reading

How to use MDC Logging in Scala?

Reading Time: 4 minutes In this blog, we’ll discuss Mapped Diagnostic Context, in short MDC. Also, we’ll see how we can use it across a single thread or multiple threads(or Futures) using some examples. What is MDC Logging? Multi-user applications need log messages to retain context. The Mapped Diagnostic Context(MDC) allows us to put context to all the log statements for a single thread. We can also propagate MDC across multiple Continue Reading

Threading and Synchronization

Reading Time: 9 minutes In this blog, we will learn about threading and synchronization in java What is a Java Thread ? A thread, in the context of Java, is the path followed when executing a program. All Java programs have at least one thread, known as the main thread, which is created by the Java Virtual Machine (JVM) at the program’s start when the main() method is invoked Continue Reading

Message Passing in Rust Threads is very helpful

Reading Time: 3 minutes Rust has been the most loved programming language for the last five years in a row. It is a low-level statically-typed multi-paradigm programming language that’s focused on safety and performance. Rust has facilities for message passing through an mpsc channel which allows various threads to communicate. Rust solves problems that C/C++ has been struggling with for a long time, such as memory errors and building concurrent programs. Due to the borrow checker, Rust can prevent data races at compile-time. Data races Continue Reading

Concurrency in Rust is indeed fearless

Reading Time: 3 minutes In modern operating systems, the executed program’s code is run in a process, and the operating system manages multiple processes at once. Within your program, you can also have independent parts that run simultaneously. The features that run these independent parts are called threads. A thread is a part of the process that runs along with the main process using a technique called context-switching. So, we can Continue Reading

Java concurrency: Reentrant Locks

Reading Time: 3 minutes Hello readers! Welcome to another blog in the Java concurrency series. Today, we are going to look at the Reentrant Locks in Java. What it is, how to use it, and mainly, what is the difference between using Reentrant Locks and synchronization. So, let’s dive straight into it. Reentrant Locks Reentrant locks work just like the synchronized locks in java, but have much more facilities Continue Reading

Java Concurrency: Thread Confinement

Reading Time: 3 minutes Hello readers! In this blog, we are going to explore about Thread Confinement, what it means and how do we achieve it. So, let’s dive straight into it.

Executor and Execution Context objects in Scala

Reading Time: 3 minutes You have come here that means you know about Threads and concurrency. If you have doubts regarding this then you can read the blog on concurrency. As Thread and Runnable have been there for long as the very first generation of concurrent execution approaches in Scala. Creating a new Thread takes less computational time compared to creating a new JVM process. we cannot afford to Continue Reading