Golang入门指南


  • 首页

  • todo

  • 思考

  • life

  • food

  • OS

  • lua

  • redis

  • Golang

  • C

  • TCP/IP

  • ebpf

  • p4

  • OpenVPN

  • IPSec

  • L2TP

  • DNS

  • distributed

  • web

  • OpenWRT

  • 运维

  • Git

  • 鸟哥的私房菜

  • IT杂谈

  • 投资

  • About Me

  • 友情链接

  • FTP

  • 搜索
close

如何管理自己的时间资产

时间: 2021-04-26   |   分类: 生活   life     |   阅读: 4036 字 ~9分钟

时间是我们最重要的资产,对时间的使用和管理决定了我们的个人成长。人的注意力是有限的,我们不能将同一份时间投入到不同的事情中,一旦选择花费时间做一些事情,就不得不放弃做其他事情的可能性。如果我们能够静下心来思考应该如何使用自己的最重要资产,一定能获得更大的个人成长和回报。

阅读全文 »

Go 面试官:什么是协程,协程和线程的区别和联系?

时间: 2021-04-25   |   分类: go   面试     |   阅读: 2026 字 ~5分钟

既要理解线程,还要讲解协程,并且诠释两者间的区别,但是由于提到线程,就必然涉及进程,因此本文将会同时梳理介绍 “进程、协程、协程” 三者的随笔知识,希望能引发大家的一些思考。

阅读全文 »

从底层到应用,想深入Map这篇文章千万不要错过!

时间: 2021-04-20   |   分类: go     |   阅读: 4175 字 ~9分钟

转载自上山打老虎的blog

超超经过了一番磨难通过了面试官单例的灵魂拷问,面试官貌似想通过一道场景应用题来考验超超对Golang的容器是否足够熟悉。下面来看看超超是如何解答的吧!

阅读全文 »

嗯,你觉得 Go 在什么时候会抢占 P?

时间: 2021-04-19   |   分类: go     |   阅读: 2215 字 ~5分钟

嗯,你觉得 Go 在什么时候会抢占 P?

前几天我们有聊到《单核 CPU,开两个 Goroutine,其中一个死循环,会怎么样?》的问题,我们在一个细节部分有提到:

img

有新的小伙伴会产生更多的疑问,那就是在 Go 语言中,是如何抢占 P 的呢,这里面是怎么做的?

阅读全文 »

The Go runtime scheduler's clever way of dealing with system calls

时间: 2021-04-19   |   分类: go     |   阅读: 758 字 ~2分钟

The Go runtime scheduler’s clever way of dealing with system calls

One of Go’s signature features is goroutines, which are lightweight threads that are managed by the Go runtime. The Go runtime implements goroutines using a M:N work stealing scheduler to multiplex goroutines on to operating system threads. The scheduler has special terminology for three important entities; a G is a goroutine, an M is an OS thread (a ‘machine’), and a P is a ‘processor’, which at its core is a limited resource that must be claimed by an M in order to run Go code. Having a limited supply of Ps is how Go limits how many things it will do at once, so as to not overload the overall system; generally there is one P per actual CPU that the OS reports (the number of Ps is GOMAXPROCS).

阅读全文 »

用 Go struct 不能犯的一个低级错误!

时间: 2021-04-18   |   分类: go     |   阅读: 1814 字 ~4分钟

转载自煎鱼的blog

用 Go struct 不能犯的一个低级错误!

原创 陈煎鱼 脑子进煎鱼了 3天前

收录于话题

#Go45

#面试题13

大家好,我是煎鱼。

前段时间我分享了 《手撕 Go 面试官:Go 结构体是否可以比较,为什么?》的文章,把基本 Go struct 的比较依据研究了一番。这不,最近有一位读者,遇到了一个关于 struct 的新问题,踩到了雷区。不得解。

阅读全文 »

Goroutine 泄露的 N 种方法,真刺激!

时间: 2021-04-18   |   分类: go     |   阅读: 2300 字 ~5分钟

转载自煎鱼的blog

大家好,我是煎鱼。

前几天分享 Go 群友提问的文章时,有读者在朋友圈下提到,希望我能够针对 Goroutine 泄露这块进行讲解,他在面试的时候经常被问到。

另外我也相信很多小伙伴,在做救火队长时排查过 Goroutine 泄露的问题,因为 Goroutine 作为一个载体,基本跑不了干系。

阅读全文 »

你知道 Go 结构体和结构体指针调用有什么区别吗?

时间: 2021-04-17   |   分类: go     |   阅读: 1153 字 ~3分钟

转载自煎鱼的blog

本期的男主角是《Go 结构体和结构体指针调用有什么区别》,希望对大家有所帮助,带来一些思考。

请在此处默念自己心目中的答案,再和煎鱼一同研讨一波 Go 的技术哲学。

阅读全文 »
67 68 69 70 71 72 73 74 75

日志
分类
标签
RSS 订阅
GitHub
© 2009 - 2025
粤ICP备2021068940号-1 粤公网安备44011302003059
0%