Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Waiting



  Difference between ConcurrentHashMap and Hashtable

Both ConcurrentHashMap and Hashtable are Collection classes for storing key value pairs and they both provide fast element search with a supplied key. They have much in common. However, we will not discuss the similarities between them here, instead we will focus on the differences between them. ConcurrentHashMap and Hashtable are both thread safe. But the mechanism for thread safe is different between them. Hashtable is synchronized, it utilizes the synchronization mechanism; while ConcurrentHa...

   ConcurrentHashMap,Hashtable     2013-11-18 08:06:54

  The first 30 tweets on Twitter

Six years ago, we didn't know what a tweet was. But now, there are 340 million tweets posted every day. Looking back, do you know what are the earliest tweets on Twitter when it was released? Let's check them out. Before that, let's check Twitter's background first. Six years ago, Twitter was called twttr (similar to Flickr), the earliest version was similar to an SMS broadcast service, i.e sending short message to friends to tell them what I am doing. It was put online on 22nd October, 2006, J...

   Twitter,history,story     2012-10-11 20:03:22

  Deep Dive into Spin Locks in Golang

In concurrent programming, a Mutex is a commonly used synchronization mechanism to protect critical resources and prevent data races. However, in certain specific scenarios, especially when the lock-holding time is short and the number of threads is limited, a more lightweight lock known as a Spin Lock can provide higher performance. What is a Spin Lock A Spin Lock is a form of busy-wait lock. When a thread attempts to acquire a lock held by another thread, it continuously checks the lock's stat...

   SPINLOCK,MUTEX,GOLANG     2024-01-10 05:53:28

  Deep Understanding of ReentrantLock: Unlocking the Mysteries of Java Concurrent Programming

ReentrantLock introduction ReentrantLock is a class in the Java concurrent package, java.util.concurrent.locks, and is an implementation of the Lock interface. As its name suggests, it is a reentrant mutual exclusion lock. A mutual exclusion lock is a synchronization tool used to protect shared resources, ensuring that only one thread can access the resource at a given time. Reentrant means that a thread can acquire the same lock multiple times without causing a deadlock. This lock provides some...

   JAVA,REENTRANTLOCK,CONCURRENCY,MULTITHREADING     2023-05-22 08:01:13

  Pinterest announces open registration

Pinterest is on-line for two years. During these two years, it gains big growth, but it needs invitation before you can register on Pinterest. Now Pinterest announces open registration, it means that anyone can register on Pinterest with emails, Facebook or Twitter accounts, no need to get invitation from others. In its official blog, Pinterest says: We’re really excited to have the capacity to offer Pinterest to more people and if you’re a Pinner with friends who’ve been wait...

   Pinterest,Social,Open registration     2012-08-09 01:56:23

  When will Google be back to China?

There will be news about Google returning back to China every now and then since the search giant left China in 2010. Every sign of change about Google in China will give people big hope on its return. But Chinese are still waiting for the dream to become true though nothing real happen until now. On Thursday, it seems there is "proof" again that Google is going back to China. In the morning, many Chinese noticed that the official Google China weibo(China's Twitter) account uploaded a photo with...

   GOOGLE,CHINA,SEARCH ENGINE,BAIDU     2017-03-02 09:39:51

  Java Concurrency Basics: CountDownLatch and CyclicBarrier

CountDownLatch CountDownLatch can be used in synchronizing behavior among threads, it makes one or more threads wait for some actions in other threads to be completed. It has a property count which defines how many countDown() need to be called before other threads which called await() to be waked up.  When a thread calls CountDownLatch.await(), the thread will be blocked until the value of count becomes 0. The initial value of count can be specified when creating the CountDownLatch instanc...

   JAVA,JAVA CONCURRENCY,COUNTDOWNLATCH,CYCLICBARRIER     2018-03-25 07:02:40

  PHP buffer: output_buffering and ob_start

buffer is one piece of memory section, it is usually 4Kb in Linux. It is mainly used between different devices with different speed or different priorities. With buffer, the waiting time between different processes will be reduced. Here is one simple example, when you type something in a text editor, every time when you type a character, the operating system will not write it to the disk directly, instead it will write it to buffer first When the buffer is full, the data in the buffer will be wr...

   PHP buffer,output_buffering,ob_start     2013-06-20 22:54:15

  Demo on creating worker pool in GoLang

A worker pool is a pool where a specified number of workers(usually goroutine) created and run to pick up tasks. This can allow multiple tasks to be ran at the same time while keeping the number of workers a fixed number to avoid overuse of resource in the program. There are usually two approaches of creating worker pool. One is with fixed number of workers pre-created One is creating worker when needed until the max number of workers created In this post, we will cover the demonstration of cr...

   WORKER POOL,GOLANG,GOROUTINE     2021-01-24 05:04:00

  What to Know About Windows 11

Windows 11 launched in October, with Microsoft bringing some changes to the operating system. It was the first name change in six years, and the rollout began on October 5. The rollout is being phased on eligible devices.  You can download it if you don’t want to wait for it to be your device’s turn.  Some businesses are opting to defer upgrades to Windows 11, as are some individuals. Others are excited to take advantage. The following are some things to know about impleme...

   MICROSOFT,WINDOWS 11     2021-12-06 10:41:04