1 前言

rt-thread可以采用软件定时器或硬件定时器来实现定时器管理的,所谓软件定时器是指由操作系统提供的一类系统接口,它构建在硬件定时器基础之上,使系统能够提供不受数目限制的定时器服务。而硬件定时器是芯片本身提供的定时功能。一般是由外部晶振提供给芯片输入时钟,芯片向软件模块提供一组配置寄存器,接受控制输入,到达设定时间值后芯片中断控制器产生时钟中断。硬件定时器的精度一般很高,可以达到纳秒级别,并且是中断触发方式。软件定时器的精度取决于它使用的硬件定时器精度。而rt-thread操作系统在默认情况下是采用的硬件定时器的方式,用户可以通过修改宏定义#ifdef RT_USING_TIMER_SOFT来修改采用哪种。

2 rt-thread的定时器的基本工作原理

在RT-Thread定时器模块维护两个重要的全局变量,一个是当前系统的时间rt_tick(当硬件定时器中断来临时,它将加1),另一个是定时器链表rt_timer_list,系统中新创建的定时期都会被以排序的方式插入到rt_timer_list(硬件定时器模式下使用)链表中,rt_timer_list的每个节点保留了一个定时器的信息,并且在这个节点加入链表时就计算好了产生时间到达时的时间点,即tick,在rt-thread系统中如果采用软件定时器模式,则存在一定时器线程rt_thread_timer_entry,不断获取当前TICK值并与定时器链表rt_timer_list上的定时器对比判断是否时间已到,一旦发现就调用对应的回调函数,即事件处理函数进行处理,而如果采用硬件定时器管理模式的话,则该检查过程放到系统时钟中断例程中进行处理,此时,是不存在定时器线程的。如下图:注:如果采用软件定时器软件定时器,则该定时器链表为rt_soft_timer_list。

3 源码分析

3.1 数据定义

[cpp] view plaincopy
  1. /**
  2. * timer structure
  3. */
  4. struct rt_timer
  5. {
  6. struct rt_object parent; //内核对象
  7. rt_list_t        list;      //链表节点
  8. void (*timeout_func)(void *parameter);  //定时器超时例程
  9. void            *parameter;       //定时器例程的传入参数
  10. rt_tick_t        init_tick;       //定时器的超时时间,即总共多长时间将产生超时事件
  11. rt_tick_t        timeout_tick;     //定时器超时的时间点,即产生超时事件时那一该的时间点
  12. };
  13. typedef struct rt_timer *rt_timer_t;

3.2 rt-thread的软件定时器模式

软件定时器线程初始化及启动:

[cpp] view plaincopy
  1. /**
  2. * @ingroup SystemInit
  3. *
  4. * This function will initialize system timer thread
  5. */
  6. void rt_system_timer_thread_init(void)
  7. {
  8. #ifdef RT_USING_TIMER_SOFT//如果采用软件定时器管理模式,则启动定时器线程
  9. rt_list_init(&rt_soft_timer_list);//初始化软件定时器链表
  10. /* start software timer thread */
  11. rt_thread_init(&timer_thread,//初始化软件定时器线程,并启动
  12. "timer",
  13. rt_thread_timer_entry,
  14. RT_NULL,
  15. &timer_thread_stack[0],
  16. sizeof(timer_thread_stack),
  17. RT_TIMER_THREAD_PRIO,
  18. 10);
  19. /* startup */
  20. rt_thread_startup(&timer_thread);
  21. #endif
  22. }

软件定时器线程如下:

[cpp] view plaincopy
  1. /* system timer thread entry */
  2. static void rt_thread_timer_entry(void *parameter)
  3. {
  4. rt_tick_t next_timeout;
  5. while (1)
  6. {
  7. /* get the next timeout tick */
  8. next_timeout = rt_timer_list_next_timeout(&rt_soft_timer_list);//得到软件定时器链表上的下一个定时器的超时时间点
  9. if (next_timeout == RT_TICK_MAX)//如果超过范围,则挂起当前线程,继续线程调度
  10. {
  11. /* no software timer exist, suspend self. */
  12. rt_thread_suspend(rt_thread_self());
  13. rt_schedule();
  14. }
  15. else
  16. {
  17. rt_tick_t current_tick;
  18. /* get current tick */
  19. current_tick = rt_tick_get();//获取当前时间点
  20. if ((next_timeout - current_tick) < RT_TICK_MAX/2)//离下个中断时间点还差些时候
  21. {
  22. /* get the delta timeout tick */
  23. next_timeout = next_timeout - current_tick;//计算还差多长时间
  24. rt_thread_delay(next_timeout);//休眠一段时间
  25. }
  26. }
  27. /* lock scheduler */
  28. rt_enter_critical();//时间到,进入临界区
  29. /* check software timer */
  30. rt_soft_timer_check();//检查是否该产生超时事件
  31. /* unlock scheduler */
  32. rt_exit_critical();//退出临界区
  33. }
  34. }

检查是否产生中断函数rt_soft_timer_check函数如下定义:

[cpp] view plaincopy
  1. /**
  2. * This function will check timer list, if a timeout event happens, the
  3. * corresponding timeout function will be invoked.
  4. */
  5. void rt_soft_timer_check(void)
  6. {
  7. rt_tick_t current_tick;
  8. rt_list_t *n;
  9. struct rt_timer *t;
  10. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("software timer check enter\n"));
  11. current_tick = rt_tick_get();//得到当前时间点
  12. for (n = rt_soft_timer_list.next; n != &(rt_soft_timer_list);)//得到下一定时器节点
  13. {
  14. t = rt_list_entry(n, struct rt_timer, list);//t指向rt_timer定时器
  15. /*
  16. * It supposes that the new tick shall less than the half duration of
  17. * tick max.
  18. */
  19. if ((current_tick - t->timeout_tick) < RT_TICK_MAX / 2)//如果当前的时间点超过定时器的超时时间点
  20. {
  21. RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t));//使用钩子函数
  22. /* move node to the next */
  23. n = n->next;//指向下一定时器
  24. /* remove timer from timer list firstly */
  25. rt_list_remove(&(t->list));//移除当前定时器
  26. /* call timeout function */
  27. t->timeout_func(t->parameter);//产生定时器超时事件,调用对应处理函数
  28. /* re-get tick */
  29. current_tick = rt_tick_get();//再次获取当前时间点
  30. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick));
  31. if ((t->parent.flag & RT_TIMER_FLAG_PERIODIC) &&//如果当前定时器是周期性定时器,则将其再次按序放入软件定时器链表
  32. (t->parent.flag & RT_TIMER_FLAG_ACTIVATED))
  33. {
  34. /* start it */
  35. t->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;//置标志为非激活状态
  36. rt_timer_start(t);//再次将定时器t放入软件定时器链表末尾
  37. }
  38. else
  39. {
  40. /* stop timer */
  41. t->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;//置标志为非激活状态
  42. }
  43. }
  44. else break; /* not check anymore */
  45. }
  46. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("software timer check leave\n"));
  47. }

上面代码中,为什么定时器里判断超时的条件是((current_tick - t→timeout_tick) < RT_TICK_MAX/2)?

因为系统时钟溢出后会自动回绕。取定时器比较最大值是定时器最大值的一半,即RT_TICK_MAX/2(在比较两个定时器值时,值是32位无符号数,相减运算将会自动回绕)。系统支持的定时器最大长度就是RT_TICK_MAX的一半:即248天(10ms/tick),124天(5ms/tick),24.5天(1ms/tick),以下内容相同道理。

其上rt_timer_start函数如下定义:

[cpp] view plaincopy
  1. /**
  2. * This function will start the timer
  3. *
  4. * @param timer the timer to be started
  5. *
  6. * @return the operation status, RT_EOK on OK, -RT_ERROR on error
  7. */
  8. rt_err_t rt_timer_start(rt_timer_t timer)
  9. {
  10. struct rt_timer *t;
  11. register rt_base_t level;
  12. rt_list_t *n, *timer_list;
  13. /* timer check */
  14. RT_ASSERT(timer != RT_NULL);
  15. if (timer->parent.flag & RT_TIMER_FLAG_ACTIVATED)//如果传入的定时器已经激活,则直接返回错误
  16. return -RT_ERROR;
  17. RT_OBJECT_HOOK_CALL(rt_object_take_hook, (&(timer->parent)));//使用钩子函数
  18. /*
  19. * get timeout tick,
  20. * the max timeout tick shall not great than RT_TICK_MAX/2
  21. */
  22. RT_ASSERT(timer->init_tick < RT_TICK_MAX / 2);
  23. timer->timeout_tick = rt_tick_get() + timer->init_tick;//得到定时器超时的时间点
  24. /* disable interrupt */
  25. level = rt_hw_interrupt_disable();//关中断
  26. #ifdef RT_USING_TIMER_SOFT//如果采用的是软件定时器管理模式,则将定时器加入到rt_soft_timer_list中
  27. if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER)
  28. {
  29. /* insert timer to soft timer list */
  30. timer_list = &rt_soft_timer_list;
  31. }
  32. else
  33. #endif
  34. {
  35. /* insert timer to system timer list */
  36. timer_list = &rt_timer_list;
  37. }
  38. for (n = timer_list->next; n != timer_list; n = n->next)//将定时器按序加入到定时器链表中
  39. {
  40. t = rt_list_entry(n, struct rt_timer, list);
  41. /*
  42. * It supposes that the new tick shall less than the half duration of
  43. * tick max.
  44. */
  45. if ((t->timeout_tick - timer->timeout_tick) < RT_TICK_MAX / 2)
  46. {
  47. rt_list_insert_before(n, &(timer->list));//将定时器timer插入到t之前
  48. break;
  49. }
  50. }
  51. /* no found suitable position in timer list */
  52. if (n == timer_list)//没有找到合适的位置,则放到链表头
  53. {
  54. rt_list_insert_before(n, &(timer->list));
  55. }
  56. timer->parent.flag |= RT_TIMER_FLAG_ACTIVATED;//置定时器为激活状态
  57. /* enable interrupt */
  58. rt_hw_interrupt_enable(level);
  59. #ifdef RT_USING_TIMER_SOFT
  60. if (timer->parent.flag & RT_TIMER_FLAG_SOFT_TIMER)//如果系统采用的是软件定时器管理模式,且软件定时器线程处理ready状态,则恢复此线程
  61. {
  62. /* check whether timer thread is ready */
  63. if (timer_thread.stat != RT_THREAD_READY)
  64. {
  65. /* resume timer thread to check soft timer */
  66. rt_thread_resume(&timer_thread);//恢复定时器线程
  67. rt_schedule();//开始线程调度
  68. }
  69. }
  70. #endif
  71. return -RT_EOK;
  72. }

软件定时器管理模式的源码分析完了,接下来介绍RTT的硬件定时器管理模式。

3.3 RTT的硬件定时器管理模式

硬件定时器管理模式顾名思义,就是说与硬件相关,因此,不用的MCU,其部分源码是不一样的,因为其要采用MCU的系统时钟中断例程来实现。

以STM32F2XX为例,先找到其启动汇编,位置在:RTT/bsp/stm32f2xx/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F2xx/startup/arm/startup_stm32f2xx.s

找到中断向量:

[plain] view plaincopy
  1. DCD     SysTick_Handler            ; SysTick Handler

这是系统时钟中断向量,再找到其中断例程实现:

在bsp/stm32f2xx/drivers/board.c文件中:

[cpp] view plaincopy
  1. /**
  2. * This is the timer interrupt service routine.
  3. *
  4. */
  5. void SysTick_Handler(void)//系统时钟中断例程
  6. {
  7. /* enter interrupt */
  8. rt_interrupt_enter();
  9. rt_tick_increase();
  10. /* leave interrupt */
  11. rt_interrupt_leave();
  12. }

其中rt_tick_increase函数在RTT/src/clock.c文件中的实现如下:

[cpp] view plaincopy
  1. /**
  2. * This function will notify kernel there is one tick passed. Normally,
  3. * this function is invoked by clock ISR.
  4. */
  5. void rt_tick_increase(void)
  6. {
  7. struct rt_thread *thread;
  8. /* increase the global tick */
  9. ++ rt_tick;//全局rt_tick加1
  10. /* check time slice */
  11. thread = rt_thread_self();//得到当前正在运行的线程
  12. -- thread->remaining_tick;//纯种剩下时间减1
  13. if (thread->remaining_tick == 0)//如果线程剩余时间为0,即调度时间已到
  14. {
  15. /* change to initialized tick */
  16. thread->remaining_tick = thread->init_tick;//将线程剩余时间重新设置初始化值
  17. /* yield */
  18. rt_thread_yield();//调度时间到,切换到其它线程
  19. }
  20. /* check timer */
  21. rt_timer_check();//检查硬件定时器链表是否有定时器产生超时事件
  22. }

其中rt_timer_check函数在RTT/src/timer.c文件中如下定义:

[cpp] view plaincopy
  1. /**
  2. * This function will check timer list, if a timeout event happens, the
  3. * corresponding timeout function will be invoked.
  4. *
  5. * @note this function shall be invoked in operating system timer interrupt.
  6. */
  7. void rt_timer_check(void)
  8. {
  9. struct rt_timer *t;
  10. rt_tick_t current_tick;
  11. register rt_base_t level;
  12. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("timer check enter\n"));
  13. current_tick = rt_tick_get();
  14. /* disable interrupt */
  15. level = rt_hw_interrupt_disable();
  16. while (!rt_list_isempty(&rt_timer_list))
  17. {
  18. t = rt_list_entry(rt_timer_list.next, struct rt_timer, list);
  19. /*
  20. * It supposes that the new tick shall less than the half duration of
  21. * tick max.
  22. */
  23. if ((current_tick - t->timeout_tick) < RT_TICK_MAX/2)
  24. {
  25. RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t));
  26. /* remove timer from timer list firstly */
  27. rt_list_remove(&(t->list));
  28. /* call timeout function */
  29. t->timeout_func(t->parameter);
  30. /* re-get tick */
  31. current_tick = rt_tick_get();
  32. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick));
  33. if ((t->parent.flag & RT_TIMER_FLAG_PERIODIC) &&
  34. (t->parent.flag & RT_TIMER_FLAG_ACTIVATED))
  35. {
  36. /* start it */
  37. t->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
  38. rt_timer_start(t);
  39. }
  40. else
  41. {
  42. /* stop timer */
  43. t->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;
  44. }
  45. }
  46. else
  47. break;
  48. }
  49. /* enable interrupt */
  50. rt_hw_interrupt_enable(level);
  51. RT_DEBUG_LOG(RT_DEBUG_TIMER, ("timer check leave\n"));
  52. }

此函数与rt_soft_timer_check基本大致相同,只不过一个是查找硬件定时器链表rt_timer_list,一个是查找rt_soft_timer_list.

在此,硬件定时器管理模式基本上介绍完毕,接下来介绍一些定时器接口.

4 定时器接口

4.1 定时器初始化

静态初始化定义器

[cpp] view plaincopy
  1. /**
  2. * This function will initialize a timer, normally this function is used to
  3. * initialize a static timer object.
  4. *
  5. * @param timer the static timer object
  6. * @param name the name of timer
  7. * @param timeout the timeout function
  8. * @param parameter the parameter of timeout function
  9. * @param time the tick of timer
  10. * @param flag the flag of timer
  11. */
  12. void rt_timer_init(rt_timer_t  timer,
  13. const char *name,
  14. void (*timeout)(void *parameter),
  15. void       *parameter,
  16. rt_tick_t   time,
  17. rt_uint8_t  flag)
  18. {
  19. /* timer check */
  20. RT_ASSERT(timer != RT_NULL);
  21. /* timer object initialization */
  22. rt_object_init((rt_object_t)timer, RT_Object_Class_Timer, name);//初始化内核对象
  23. _rt_timer_init(timer, timeout, parameter, time, flag);
  24. }

_rt_timer_init函数如下定义:

[cpp] view plaincopy
  1. static void _rt_timer_init(rt_timer_t timer,
  2. void (*timeout)(void *parameter),
  3. void      *parameter,
  4. rt_tick_t  time,
  5. rt_uint8_t flag)
  6. {
  7. /* set flag */
  8. timer->parent.flag  = flag;//置flag
  9. /* set deactivated */
  10. timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;//初始化时,设置为非激活状态
  11. timer->timeout_func = timeout;//设置超时事件处理函数
  12. timer->parameter    = parameter;//超时事件处理函数的传入参数
  13. timer->timeout_tick = 0;//定时器的超时时间点初始化时为0
  14. timer->init_tick    = time;//置超时时间
  15. /* initialize timer list */
  16. rt_list_init(&(timer->list));//初始化本身节点
  17. }

动态创建定时器

[cpp] view plaincopy
  1. /**
  2. * This function will create a timer
  3. *
  4. * @param name the name of timer
  5. * @param timeout the timeout function
  6. * @param parameter the parameter of timeout function
  7. * @param time the tick of timer
  8. * @param flag the flag of timer
  9. *
  10. * @return the created timer object
  11. */
  12. rt_timer_t rt_timer_create(const char *name,
  13. void (*timeout)(void *parameter),
  14. void       *parameter,
  15. rt_tick_t   time,
  16. rt_uint8_t  flag)
  17. {
  18. struct rt_timer *timer;
  19. /* allocate a object */
  20. timer = (struct rt_timer *)rt_object_allocate(RT_Object_Class_Timer, name);//动态分配定时器内核对象
  21. if (timer == RT_NULL)
  22. {
  23. return RT_NULL;
  24. }
  25. _rt_timer_init(timer, timeout, parameter, time, flag);//调用上述的初始化接口
  26. return timer;
  27. }

4.2 脱离和删除

脱离:

[cpp] view plaincopy
  1. /**
  2. * This function will detach a timer from timer management.
  3. *
  4. * @param timer the static timer object
  5. *
  6. * @return the operation status, RT_EOK on OK; RT_ERROR on error
  7. */
  8. rt_err_t rt_timer_detach(rt_timer_t timer)
  9. {
  10. register rt_base_t level;
  11. /* timer check */
  12. RT_ASSERT(timer != RT_NULL);
  13. /* disable interrupt */
  14. level = rt_hw_interrupt_disable();//关中断
  15. /* remove it from timer list */
  16. rt_list_remove(&(timer->list));//从定时器链表中移除
  17. /* enable interrupt */
  18. rt_hw_interrupt_enable(level);//开中断
  19. rt_object_detach((rt_object_t)timer);//脱离内核对象
  20. return -RT_EOK;
  21. }

删除动态创建的定时器

[cpp] view plaincopy
  1. /**
  2. * This function will delete a timer and release timer memory
  3. *
  4. * @param timer the timer to be deleted
  5. *
  6. * @return the operation status, RT_EOK on OK; RT_ERROR on error
  7. */
  8. rt_err_t rt_timer_delete(rt_timer_t timer)
  9. {
  10. register rt_base_t level;
  11. /* timer check */
  12. RT_ASSERT(timer != RT_NULL);
  13. /* disable interrupt */
  14. level = rt_hw_interrupt_disable();//关中断
  15. /* remove it from timer list */
  16. rt_list_remove(&(timer->list));//从定时器链表中移除
  17. /* enable interrupt */
  18. rt_hw_interrupt_enable(level);//开中断
  19. rt_object_delete((rt_object_t)timer);//删除动态创建的定时器内核对象
  20. return -RT_EOK;
  21. }

4.3 启动定时器

[cpp] view plaincopy
  1. /**
  2. * This function will start the timer
  3. *
  4. * @param timer the timer to be started
  5. *
  6. * @return the operation status, RT_EOK on OK, -RT_ERROR on error
  7. */
  8. rt_err_t rt_timer_start(rt_timer_t timer)

此接口已在上面介绍软件定时器模式时已有分析,这里就不再重复了。

4.4 停止定时器

[cpp] view plaincopy
  1. /**
  2. * This function will stop the timer
  3. *
  4. * @param timer the timer to be stopped
  5. *
  6. * @return the operation status, RT_EOK on OK, -RT_ERROR on error
  7. */
  8. rt_err_t rt_timer_stop(rt_timer_t timer)
  9. {
  10. register rt_base_t level;
  11. /* timer check */
  12. RT_ASSERT(timer != RT_NULL);
  13. if (!(timer->parent.flag & RT_TIMER_FLAG_ACTIVATED))//如果定时器已经为非激活状态
  14. return -RT_ERROR;
  15. RT_OBJECT_HOOK_CALL(rt_object_put_hook, (&(timer->parent)));//使用钩子函数
  16. /* disable interrupt */
  17. level = rt_hw_interrupt_disable();//关中断
  18. /* remove it from timer list */
  19. rt_list_remove(&(timer->list));//从定时器链表中移除
  20. /* enable interrupt */
  21. rt_hw_interrupt_enable(level);//开中断
  22. /* change stat */
  23. timer->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED;//置非激活状态
  24. return RT_EOK;
  25. }

4.5 控制

此接口是用来修改一个定时器的参数,如下代码:

[cpp] view plaincopy
  1. /**
  2. * This function will get or set some options of the timer
  3. *
  4. * @param timer the timer to be get or set
  5. * @param cmd the control command
  6. * @param arg the argument
  7. *
  8. * @return RT_EOK
  9. */
  10. rt_err_t rt_timer_control(rt_timer_t timer, rt_uint8_t cmd, void *arg)
  11. {
  12. /* timer check */
  13. RT_ASSERT(timer != RT_NULL);
  14. switch (cmd)
  15. {
  16. case RT_TIMER_CTRL_GET_TIME://获取时间参数
  17. *(rt_tick_t *)arg = timer->init_tick;
  18. break;
  19. case RT_TIMER_CTRL_SET_TIME://修改时间参数
  20. timer->init_tick = *(rt_tick_t *)arg;
  21. break;
  22. case RT_TIMER_CTRL_SET_ONESHOT://修改定时器模式为单次触发定时器
  23. timer->parent.flag &= ~RT_TIMER_FLAG_PERIODIC;
  24. break;
  25. case RT_TIMER_CTRL_SET_PERIODIC://修改定时器为周期触发定时器
  26. timer->parent.flag |= RT_TIMER_FLAG_PERIODIC;
  27. break;
  28. }
  29. return RT_EOK;
  30. }

完!

rt-thread的定时器管理源码分析相关推荐

  1. REST framework 权限管理源码分析

    REST framework 权限管理源码分析 同认证一样,dispatch()作为入口,从self.initial(request, *args, **kwargs)进入initial() def ...

  2. linux源码文件名,Linux中文件名解析处理源码分析

    Linux中文件名解析处理源码分析 前言 Linux中对一个文件进行操作的时候,一件很重要的事情是对文件名进行解析处理,并且找到对应文件的inode对象,然后创建表示文件的file对象.在此,对文件名 ...

  3. 动态代理原理源码分析

    看了这篇文章非常不错转载:https://www.jianshu.com/p/4e14dd223897 Java设计模式(14)----------动态代理原理源码分析 上篇文章<Java设计模 ...

  4. Linux内核 eBPF基础:kprobe原理源码分析:源码分析

    Linux内核 eBPF基础 kprobe原理源码分析:源码分析 荣涛 2021年5月11日 在 <Linux内核 eBPF基础:kprobe原理源码分析:基本介绍与使用>中已经介绍了kp ...

  5. Linux内核 eBPF基础:kprobe原理源码分析:基本介绍与使用示例

    Linux内核 eBPF基础 kprobe原理源码分析:基本介绍与使用示例 荣涛 2021年5月11日 kprobe调试技术是为了便于跟踪内核函数执行状态所设计的一种轻量级内核调试技术. 利用kpro ...

  6. Linux内核 eBPF基础:Tracepoint原理源码分析

    Linux内核 eBPF基础 Tracepoint原理源码分析 荣涛 2021年5月10日 1. 基本原理 需要注意的几点: 本文将从sched_switch相关的tracepoint展开: 关于st ...

  7. 分享一篇glibc 2.30内存管理源码分析

    分享一篇glibc 2.30内存管理源码分析,出于时间关系文章中可能存在问题(如纰漏.或者解释不顺,后续我会持续更新修正),还请大家海涵,大家互相探讨,也多多希望大家指出文章中问题,我及时斧正.本文只 ...

  8. Java Review - 并发编程_ThreadLocalRandom实现原理源码分析

    文章目录 概述 Random的局限性 ThreadLocalRandom使用及原理 使用 原理 ThreadLocalRandom源码分析 ThreadLocalRandom current() 该方 ...

  9. (转)Spring对注解(Annotation)处理源码分析1——扫描和读取Bean定义

    1.从Spring2.0以后的版本中,Spring也引入了基于注解(Annotation)方式的配置,注解(Annotation)是JDK1.5中引入的一个新特性,用于简化Bean的配置,某些场合可以 ...

最新文章

  1. 使用Docsify搭建Markdown文件服务器
  2. 英特尔物联网产业的布局中,优势和劣势都在哪?
  3. python实现tsne
  4. excel统计行数_工程人常用的12个excel和9个wps技巧
  5. C语言天才!想法奇异?还是逼格满满?一份国外C语言写的传奇简历
  6. linux下opencv读取图片并存储到mysql数据库中
  7. 华为5G折叠屏手机Mate X 重新入网,即将上市!
  8. 谷歌 .dev 顶级域名正式开放
  9. unity 实现手机振动_unity 调用android的震动
  10. 剑指offer最新版_剑指offer第二版速查表
  11. JVM 字节码 栈图(Stack Map Table) 学习笔记
  12. 时空序列预测之PredRNN++(Casual LSTM和GHU解决时空预测学习中的深度困境)
  13. NotePad++ HexEditor.dll下载地址,32位,64位
  14. div点击穿透,CSS属性pointer-events :none;实现护眼模式, 夜间模式遮罩
  15. MVGCN 人群流量预测模型 笔记
  16. 巫启贤《太傻》背后的故事
  17. Federico Ferrari 和Ole Sigmund的高效3D拓扑优化程序
  18. 把videos对应标签的.avi文件转为kinetics400的格式,其中所包含的格式有.csv和.json格式
  19. 无锡市民健康档案信息系统云计算平台集成
  20. PVC 塑料片BS 476-6 火焰传播性能测定

热门文章

  1. Cocos2dx小技巧 单例
  2. 【转】老程序猿给新程序猿的13点建议
  3. 【我眼中的戴尔转型】 (二) 厚积薄发,戴尔扩大战线迎头追击IBM HP
  4. KDE发布四月份更新(4.6.2),与GNOME同祝
  5. Android Studio3.x上使用Lombok
  6. mesos安装,webui显示不正常
  7. PHP date 格式化一个本地时间/日期
  8. SQL多表连接查询(详细实例)
  9. 所谓的创业分享,都是一堆骗人骗己的谎言?
  10. 我进公司当Android开发实习生时,初中最差的同学成了我的领导