Coder Social home page Coder Social logo

Comments (4)

zhu121 avatar zhu121 commented on May 17, 2024 1

gopher实现的相关疑惑:
gopher_unix.go/L36:for j := 0; j < len(g.lfds); j++ {}多余的吗?没有看到lfds的初始化或其他使用
gopher_std.go/L22:g.lfds = []int{}也是类似的

from nbio.

lesismal avatar lesismal commented on May 17, 2024

是的,应该是早期实现的时候 windows 和 uni* 差别,后来整理了没那么细,但是只有windows上面重复了,而且没什么影响,uni*没有第二次make:
https://github.com/lesismal/nbio/blob/master/gopher_unix.go#L23

并且这种make后没使用的内存不会真正分配内存

我把windows重复的这句去掉,感谢反馈!

from nbio.

lesismal avatar lesismal commented on May 17, 2024

gopher实现的相关疑惑: gopher_unix.go/L36:for j := 0; j < len(g.lfds); j++ {}多余的吗?没有看到lfds的初始化或其他使用 gopher_std.go/L22:g.lfds = []int{}也是类似的

应该是多余的,最早时候是用的 syscall,单个 epoll 单个 goroutine 处理多个 listener fd 的,后来改成直接用标准库了,清理的时候漏掉了、遗留下的,不影响使用。
难得有人来阅读代码,有兴趣欢迎来 pr 一下、多多指正一些

from nbio.

lesismal avatar lesismal commented on May 17, 2024

这个可以先关闭了吗?

from nbio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.