18 Matching Annotations
  1. Dec 2022
  2. Oct 2022
    1. 在新版本(起码 1.15 及以后)的 Go 当中,sync.Pool 里的临时对象需要两次 GC 才会被真正清除掉。 // 只一次 GC 的话只会让其中的临时对象被“打上记号”。 // 更具体的说,只做一次 GC 只会使得 sync.Pool 里的临时对象被移动到池中的“备用区域”(详见 victim 字段)。 // 在我们调用 sync.Pool 的 Get 方法时,如果 sync.Pool 的“本地区域”(详见 local 字段)当中没有可用的临时对象, // 那么 sync.Pool 会试图从这个“备用区域”中获取临时对象。 // 如果“备用区域”也没有可用的临时对象,sync.Pool 才会去调用 New 函数。 // 所以,这里的例子需要再添加一行对 runtime.GC() 函数的调用,才能使它的结果与最初的相同,并起到准确示范的作用。

      runtime.GC()

  3. Aug 2022
    1. 换句话说线程在跑

      线程是gc root,然后线程又是引用了外部的线程池,只要线程不被回收(核心线程在allowCoreThreadTimeOut为false的情况下不会被回收),那么线程池也不会被回收。

    2. 线程在跑

      线程是gc root,然后线程又是引用了外部的线程池,只要线程不被回收(核心线程在allowCoreThreadTimeOut为false的情况下不会被回收),那么线程池也不会被回收。

  4. May 2018
    1. A foe in the hall-building: this horrible stranger2 50 Was Grendel entitled, the march-stepper famous Who3 dwelt in the moor-fens, the marsh and the fastness; The wan-mooded being abode for a season [5] In the land of the giants, when the Lord and Creator Had banned him and branded. For that bitter murder, 55 The killing of Abel, all-ruling Father Cain is referred to as a progenitor of Grendel, and of monsters in general. The kindred of Cain crushed with His vengeance;

      Absolutely unnecessary to add all this nonsensical Christian stuff to the text. The story would have flowed much better without it.

  5. Jul 2017
    1. When educators leverage these types of informal learning by giving agency to the students to use their mobile technologies and by providing the structure and skills for their use within more formal educational settings, motivation and learning are increased.

      Yet so many teachers prohibit and collect phones when you come into class. This is something administrators can encourage a shift in.