原创 Parallel program running in dual-core environment

Recently I have been studying parallel programming. Paralleled programs can get better performance in multicore machine

原创 The end, the new beginning

 Four years of college life has ended. There are so many memories of all ki

原创 Print the bit pattern of a float

We can use bit shifting and bit-and operator to print out the bit pattern of an integer(a short, an int, a long, or eve

原创 Two more accurate ways to get time elapsed than clock()

The following program shows these two ways. #include <stdio.h>#include <windows.h>#include <assert.h>#include <stdlib.h

原创 Communications of Processes and Threads

Communications of Processes There are 5 ways for processes to communicate with each other. 1. Environment Variable/File

原创 Pipes used for Interprocess Communication

"Interprocess communication in MINIX uses pipes. When a user types cat file1 file2 | sort the shell creates a pipe and

原创 Do you know the sizes of these things in real memory?

It costs less time for CPU to read data from memory or write data into memory if the address of the data is divisible b

原创 Some confusing mechanisms in Java

I am sure many people heard some concepts or mechanisms while learning Java and almost always got confused by different

原创 Issues related to IPC

There are briefly three issues related to IPC (InterProcess Communication): 1. How one process can pass information to

原创 Three classical IPC problems

1. The Dining Philosophers Problem The key point is to make sure that a philosopher should get two forks at one time, n

原创 Something after main function exits

When the program runs to the end of the main function, or more strictly, returns some value in main(), it means the who

原创 Three Methods to Parallel Programming Decomposition

The key point to write parallel programs is to treat the program as a set of many related or unrelated sub-tasks. The p

原创 CPU Identification

Here is some code to check out your cpu identification using CPUID instruction. Try it first. #include <cstdio>#include

原创 Some basic details of template in C++

 The introdution of template into C++ makes it more flexible and more capable to support generic design and programming

原创 Use pthread_exit() To Terminate main() With The Other Threads Alive

When you program with POSIX Threads API, there is one thing about pthread_exit() that you may ignore for mistake. In su