V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  YanSeven  ›  全部回复第 1 页 / 共 20 页
回复总数  392
1  2  3  4  5  6  7  8  9  10 ... 20  
啥意思,搭了一套前端出来,还是前后端都写了。
18 小时 16 分钟前
回复了 YanSeven 创建的主题 Go 编程语言 goroutine 到底算不算一种 coroutine 的实现?
@Dorathea 因为基本上所有的中文资料都叫”go 协程“,望文生义字面上理解的话,意思就像是 go 的 coroutine 实现。
支持高清导出吗
@shunia 做点文档类的工作还不错,主打一个 AI Studio 量大管饱。
auto 默认视为免费模型,虽然每次更新重启它都默认给你设置成 auto 。模型只用 claude 和 gpt 的最新模型
4 天前
回复了 YanSeven 创建的主题 Java Java 的一次编译到处运行在目前还有优势吗
@renfei 那 JVM 的适配是国产化 CPU 厂商自己提供的吗。
今年硬盘太离谱了,买个网盘挺一阵儿吧。
可能表现过于强势了,和目标岗位不符合。
5 天前
回复了 YanSeven 创建的主题 分享发现 https://superuser.com/
@selca 还真是,发现和 stackoverflow 是一家的,之前用 stackoverflow 多。这个网站倒是第一次检索到
同类竞品打差异化啊,譬如百度的服务是 online 的,有隐私问题吧。如果你支持接入本地模型。那就是类似云笔记有 notion 这种的,也有 obsidian 这种本地为先的,还有完全开源的其他自部署的笔记软件。

即使同一类产品,目标受众也会有不同,特性也会不同。
这个就如同完全让”智驾”在路上狂飙一样让人心惊胆战。
Maps are not safe for concurrent use: it’s not defined what happens when you read and write to them simultaneously. If you need to read from and write to a map from concurrently executing goroutines, the accesses must be mediated by some kind of synchronization mechanism. One common way to protect maps is with sync.RWMutex.
映射结构不适用于并发场景:当同时进行读写操作时,其行为是未定义的。若需要在并发执行的 goroutine 中对映射进行读写操作,必须通过某种同步机制来协调访问。保护映射的常用方式之一是使用 sync.RWMutex 。

This statement declares a counter variable that is an anonymous struct containing a map and an embedded sync.RWMutex.
该语句声明了一个 counter 变量,这是一个包含映射和嵌入式 sync.RWMutex 的匿名结构体。

var counter = struct{
sync.RWMutex
m map[string]int
}{m: make(map[string]int)}
To read from the counter, take the read lock:
读取计数器时需获取读锁:

counter.RLock()
n := counter.m["some_key"]
counter.RUnlock()
fmt.Println("some_key:", n)
To write to the counter, take the write lock:
写入计数器时需获取写锁:

counter.Lock()
counter.m["some_key"]++
counter.Unlock()

来源: https://go.dev/blog/maps?utm_source=chatgpt.com
@viking602 goland 有啥体验是 vscode 无法提供的吗,目前我 go 开发几乎都是 vscode 了,goland 尝试了几次,没用下去
@looplj WindSurf 的 Teams 里面最多能加几个人。
补上一个 Trae
6 天前
回复了 charoneo 创建的主题 程序员 写代码用 claude code 还是 codex?
claude code 用不到,疯狂封,只能 codex
原文档内容:The zero Map is empty and ready for use. A Map must not be copied after first use.

Map 的定义如下:
```
type Map struct {
_ noCopy // 这个在源码中设置

m isync.HashTrieMap[any, any]
}
```

noCopy 类型的说明:
noCopy may be added to structs which must not be copied
after the first use.

See https://golang.org/issues/8005#issuecomment-190753527
for details.

Note that it must not be embedded, due to the Lock and Unlock methods.

如果你想问,进一步为什么 Map 是“noCopy"的,需要进一步研究 HashTrieMap 的结构:

```go
type HashTrieMap[K comparable, V any] struct {
inited atomic.Uint32
initMu Mutex
root atomic.Pointer[indirect[K, V]]
keyHash hashFunc
valEqual equalFunc
seed uintptr
}
```
可以看到里面封装了 Mutex ,先不管其他变量,至少 Mutex 是肯定不可拷贝的, 内部维护锁的状态( locked/unlocked )以及等待队列这些资源。
GLM 肯定是比不上 Codex 。但是胜在省钱。
@juggtt213 没错,你说的这个场景正是我问问题时的场景。
MacOS+虚拟机,或许在续航上仍能一战。Mac 开发涉及到编译也很难和纯 Linux 一样,得操心一下一些底层的框架和库,毕竟和跑程序的主流的硬件架构以及 OS 都不一样。
1  2  3  4  5  6  7  8  9  10 ... 20  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   4822 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 09:46 · PVG 17:46 · LAX 02:46 · JFK 05:46
♥ Do have faith in what you're doing.