施泰俊

@Kevin-Shih

NCKU GM & CSIE 2018~2023 (expected)

Joined on Feb 15, 2022

  • contributed by < Kevin-Shih > 開發環境 $ gcc --version gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian
     Like 2 Bookmark
  • contributed by < Kevin-Shih > 測驗題目 quiz6 final project github 問題描述 〈UNIX 作業系統 fork/exec 系統呼叫的前世今生〉提到 clone 系統呼叫,搭配閱讀〈Implementing a Thread Library on Linux〉,嘗試撰寫一套使用者層級的執行緒函式庫,程式碼可見: readers.c 運作原理與解題 :::danger
     Like  Bookmark
  • contributed by < Kevin-Shih > 測驗 1 題目描述 完整程式碼: memchr_opt.c 當 length 大於等於 LBLOCKSIZE 時 unsigned long *asrc = (unsigned long *) src;
     Like  Bookmark
  • contributed by < Kevin-Shih > 第 5 週測驗題 測驗 1 題目 利用 Sieve of Eratosthenes,嘗試找出第 1500 個回文質數,有效位數是 15。 預期執行結果為 100191191191001。 完整程式碼: prime_palindrome.c :::warning
     Like  Bookmark
  • 測驗 1 memchr_opt 函式完整程式碼: #include <stddef.h> #include <stdint.h> #include <limits.h> #include <string.h> /* Nonzero if X is not aligned on a "long" boundary */ #define UNALIGNED(X) ((long) X & (sizeof(long) - 1))
     Like  Bookmark
  • contributed by < Kevin-Shih > 執行環境 :::spoiler lscpu $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 4
     Like  Bookmark
  • contributed by < Kevin-Shih > 作業環境 硬體 CPU: Intel® Core™ i5-7300HQ CPU @ 2.50GHz × 4 :::spoiler lscpu$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian
     Like  Bookmark
  • contributed by < Kevin-Shih > 測驗 1 題目 在 Linux 核心原始程式碼,include/linux/bitfield.h 提及一個巨集 GENMASK,其作用是依據給定的範圍,產生連續的 bitmask,例如: GENMASK(6, 4) 產生 01110000~2~ GENMASK(39, 21) 產生 0x000000ffffe00000 (64 位元)
     Like  Bookmark
  • contributed by < Kevin-Shih > 測驗 1 對二個無號整數取平均 EXP1: 考慮以下對二個無號整數取平均值的程式碼: #include <stdint.h> uint32_t average(uint32_t a, uint32_t b) {
     Like  Bookmark
  • contributed by < Kevin-Shih > 測驗一 LeetCode 1 Two Sum 所用到的結構 map: hash table typedef struct { int bits; // 用於紀錄 hash table 大小為 2^bits struct hlist_head *ht;
     Like  Bookmark