Skip to content

code logic for reader.go #273

Answered by marceloamaral
SamYuan1990 asked this question in Q&A
Discussion options

You must be logged in to vote

lock.lock() not follow with defer lock.unlock()

We unlock in the end and there is no branch in between, so we don't need the defer

this read() function seems been invoked only once? hence may I know the reason for reset() functions?

Yes. We have an infinity loop reading the data, as expected from this function
As @rootfs said before, we must reset the counters every time that we will read the data from eBPF

for loop logic as round robin, should we consider a go routine base on pod id? (each pod id as a key and a go routine for update?)

We don't need to create a go routine for each pod.

gpu device decouple from current logic? in case on no gpu?

I think it is better to keep everythi…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@rootfs
Comment options

@SamYuan1990
Comment options

SamYuan1990 Oct 3, 2022
Maintainer Author

@rootfs
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by SamYuan1990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants