随笔分类 - 计算机基础知识
本科所涉猎范围
摘要:1 #include<iostream> 2 #include<vector> 3 using namespace std; 4 5 6 struct Sort { 7 8 inline void operator()(vector<int>&vec){ 9 for (int N = vec.siz
阅读全文
摘要:1. First, write a simple program called null.c that creates a pointer to an integer, sets it to NULL, and then tries to dereference it. Compile this i
阅读全文
摘要:2. Now, run free, perhaps using some of the arguments that might be useful (e.g., -m, to display memory totals in megabytes). How much memory is in yo
阅读全文
摘要:1. Compute the solutions for simulations with 3 jobs and random seeds of 1, 2, and 3. siuwhat@siuwhat-PC:~/Desktop/HW-Lottery$ ./lottery.py -j 3 -s 1
阅读全文
摘要:1. Run a few randomly-generated problemswith just two jobs and two queues; compute the MLFQ execution trace for each. Make your life easier by limitin
阅读全文
摘要:1. Compute the response time and turnaround time when running three jobs of length 200 with the SJF and FIFO schedulers. 没区别, 响应时间 周转时间 等待时间 1 0 200 0
阅读全文
摘要:测试上下文时间 Homework (Measurement) ASIDE: MEASUREMENT HOMEWORKS Measurement homeworks are small exercises where you write code to run on a real machine, i
阅读全文
摘要:1. Write a program that calls fork(). Before calling fork(), have the mainprocess access a variable (e.g., x) and set its value to something (e.g., 10
阅读全文
摘要:Linux描述符表和描述符高速缓存 (摘自http://hengch.blog.163.com/blog/static/107800672009028105929795/)推荐对DOS感兴趣的看一下他的博客 在80x86的CPU里,描述符的概念实在是太重要了。 在实模式下,大家都知道物理地址是由段地
阅读全文
摘要:看csapp时候,看一下char*[8],以为char*也是一字节,但是指针是地址,64位编译器下是8字节,所以sizeof(B)是64字节 后来又看strlen()。 1 #include"stdio.h" 2 #include"string.h" 3 int main(void){ 4 char
阅读全文
No enclosing instance of type test is accessible. Must qualify the allocation with an enclosing inst
摘要:今日遇到一个报错如下: No enclosing instance of type test is accessible. Must qualify the allocation with an enclosing instance of type test (e.g. x.new A() wher
阅读全文
摘要:计算机操作系统锁机制. 在多线程编程中,操作系统引入了锁机制。通过锁机制,能够保证在多核多线程环境中,在某一个时间点上,只能有一个线程进入临界区代码,从而保证临界区中操作数据的一致性。 所谓的锁,可以理解为内存中的一个整型数,拥有两种状态:空闲状态和上锁状态。加锁时,判断锁是否空闲,如果空闲,修改为
阅读全文

浙公网安备 33010602011771号