Skip to main content
Home › Blog › #threading
Tag

#threading

6 articles
Can you explain what thread safety is and how you would ensure that a shared resource is accessed safely in a multithreaded environment?

Thread safety means that a piece of code can be safely called by multiple threads at the same time without leading to data corruption or unexpected behavior. To ensure thread…

🏷️
What is the GIL in Python and how does it affect multithreading?

The Global Interpreter Lock (GIL) is a mutex that prevents multiple native threads from executing Python bytecode simultaneously. It makes Python threads unsuitable for CPU-bound parallelism.

🏷️
How can you effectively identify and mitigate thread contention in a high-concurrency Java application?

To identify thread contention, I typically use profiling tools like VisualVM or Java Flight Recorder to monitor thread states and lock contention metrics. Mitigation strategies include optimizing the granularity of…

🏷️
What is the difference between multiprocessing threading and asyncio in Python — and how do you choose?

Threading is for I/O-bound tasks with moderate concurrency. Asyncio is for I/O-bound tasks with high concurrency and fine-grained control. Multiprocessing is for CPU-bound tasks requiring true parallelism. The GIL makes…

🏷️
Can you explain the concept of asynchronous programming in C# and how it differs from synchronous programming?

Asynchronous programming in C# allows methods to run in a non-blocking manner using the async and await keywords. This means that while a method is waiting for a task to…

🏷️
How would you optimize a Python application that is spending too much time on I/O operations, and what tools would you use to measure the impact of your optimizations?

To optimize I/O operations in a Python application, I would consider using asynchronous programming with asyncio or threading to handle I/O-bound tasks concurrently. Tools like cProfile and line_profiler can help…

🏷️
2,000 Interview Questions and Answers PDF cover
Developer Interview Kit · PDF

2,000 Interview Questions & Answers, in one PDF

  • Short answers, in-depth explanations, common mistakes and follow-ups
  • 89 topics, from Beginner to Architect, with a clickable contents list
  • 226 extra questions that are not on this website
  • Free Bonus Pack: 30-day study plan, behavioral questions, salary scripts
$7.99 one-time · instant email delivery
260 Developer Learning Paths cover
Also available: 260 Developer Learning Paths $4.99 Week-by-week roadmaps for 16 career tracks (Python, React, Java, DevOps, SQL, AI and more), with a progress tracker on every path. See what's inside →

Get both books for $9.99 (save $2.99):

The material stays free to read online. This is the organised, offline, print-ready PDF edition. Secure payment by PayPal; your personal download link is emailed after payment is confirmed. Digital product, no shipping.