The difference between Call Gate, Interrupt Gate, Trap Gate?

A gate (call, interrupt, task or trap) is used to transfer control of execution across segments. Privilege level checking is done differently depending on the type of destination and instruction used. A call gate uses the CALL and JMP instructions. Call gates transfer control from lower privilege code to higher privilege code. The gate DPL … Read more

how to set CPU affinity of a particular pthread?

This is a wrapper I’ve made to make my life easier. Its effect is that the calling thread gets “stuck” to the core with id core_id: // core_id = 0, 1, … n-1, where n is the system’s number of cores int stick_this_thread_to_core(int core_id) { int num_cores = sysconf(_SC_NPROCESSORS_ONLN); if (core_id < 0 || core_id … Read more

What’s the difference between a single precision and double precision floating point operation?

Note: the Nintendo 64 does have a 64-bit processor, however: Many games took advantage of the chip’s 32-bit processing mode as the greater data precision available with 64-bit data types is not typically required by 3D games, as well as the fact that processing 64-bit data uses twice as much RAM, cache, and bandwidth, thereby … Read more

How do cache lines work?

If the cache line containing the byte or word you’re loading is not already present in the cache, your CPU will request the 64 bytes that begin at the cache line boundary (the largest address below the one you need that is multiple of 64). Modern PC memory modules transfer 64 bits (8 bytes) at … Read more

How to determine whether a given Linux is 32 bit or 64 bit?

Try uname -m. Which is short of uname –machine and it outputs: x86_64 ==> 64-bit kernel i686 ==> 32-bit kernel Otherwise, not for the Linux kernel, but for the CPU, you type: cat /proc/cpuinfo or: grep flags /proc/cpuinfo Under “flags” parameter, you will see various values: see “What do the flags in /proc/cpuinfo mean?” Among … Read more

tech