Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support percentage cpu waste using PID #30

Merged
merged 4 commits into from
Mar 25, 2023

Conversation

r3inbowari
Copy link
Contributor

@r3inbowari r3inbowari commented Mar 23, 2023

related to #28 #22 #25 #27

@layou233
Copy link
Owner

layou233 commented Mar 24, 2023

我一直在思考,一个无限空 loop 是否真的适合?我在很多类似脚本里看到用空 loop 来浪费 CPU,但实际上这会造成非常频繁的跳转指令,非常易于识别。事实上 host 只要尝试检测这类特征就能轻松识别这种程序,但目前也许足够了。

另外,这个看起来十分有趣。我觉得我们可以把他部分实现移到一个新 package 里(或者让一些东西私有),只让 waste package 提供类似 CPUMemory 之类的直接可用的函数。😋

感谢 PR!

@r3inbowari
Copy link
Contributor Author

我在很多类似脚本里看到用空 loop 来浪费 CPU

忘了把chacha20放回去了😓

@layou233
Copy link
Owner

我重新格式化了下,把 initMachine 重命名为 newMachine 并且把 crypto/rand 改为 math/rand 因为我们不需要 CSPRNG。

@layou233 layou233 merged commit f7d3056 into layou233:master Mar 25, 2023
@r3inbowari r3inbowari deleted the add/pidcpu branch March 25, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants