Тёмный

How many kernel system calls does Rust make? 

Dario
Подписаться 8 тыс.
Просмотров 4,9 тыс.
50% 1

If you want to know how many kernel system calls Rust makes, then this video is for you. Dive into the world of Rust programming and Linux system calls to expand your knowledge!
#rustlang #linux

Опубликовано:

 

22 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@hnasr
@hnasr День назад
very interesting, thanks for doing rust! I wouldn’t have guessed what it was doing extra. now you are making me wonder what if we wrote the code without using the stdio library (which is just a wrapper to system calls) and did the system calls directly..
@dario.lencina
@dario.lencina День назад
You are right! not using stdio should save a few calls!!
@kartik4792
@kartik4792 День назад
Great videos @hnasr @dario.lencina! I think we should have a repo with examples like these with syscall analysis for different languages.
@dario.lencina
@dario.lencina День назад
@@kartik4792 I love your idea!!
@hamdysaadpersonal
@hamdysaadpersonal День назад
so it's just rust added more steps, to prevent the user from making the system crash, interesting :) 💡
@dario.lencina
@dario.lencina День назад
Yes! Saving devs from Themselves!!!
@kamurashev
@kamurashev 7 часов назад
Maybe or maybe not. Can it happen compile time and not runtime if not everything but maybe some portion of it?
@guyno_one293
@guyno_one293 День назад
Dang I wrote an ASM program that war only slightly more complex than this and it used 3 syscalls (fstat, mmap, print). EDIT: I recounted and it's 5, although 2 of them wouldn't have been needed for this (exit and close).
@dario.lencina
@dario.lencina 12 часов назад
Did you write in sarcasm64 or did you actually write it?
@kamurashev
@kamurashev 7 часов назад
Dumb to think it’s ok to do a lot of stuff when it can be done with less. The good question was risen in the original video, isn’t it a good time to take a step back, sit and rethink the approaches. Combining calls? Adding some one-means-a-bunch calls to the api? Other ideas? I’m not a kernel developer and know nothing about that but those questions seem reasonable.
@iulikdev
@iulikdev День назад
Very good explication. I follow Nasser, he has very interesting topics.
@dario.lencina
@dario.lencina День назад
I follow him too! He is awesome!
@cunningham.s_law
@cunningham.s_law День назад
signals don't need threads in c you should try to add libpthread to your empty c bin and still compare the calls also the original video by Hussein makes no sense imo most of these system calls are only called once and the cost will be amortized over thte long run for something like a webserver a better approach would be to open and read form a file 10000 times tom compare the calls or onlt strace after the initial startup but it's harder to do
@dario.lencina
@dario.lencina День назад
Comprehensive response and even better profile pic 😄 did you see the part where I mention that less calls does not mean “better”?
@Jalae
@Jalae День назад
frankly loading pthreads for no reason is a fail. modern c is pretty trash too, and elf binaries do no service to this problem. this program should be 3 words or less.
@barry_wastaken
@barry_wastaken День назад
04:05 you literally didn't remove the includes, how is that an apple to apple comparison?
@dario.lencina
@dario.lencina День назад
Good point, I’ll do it then report the result back
@kimsdo7
@kimsdo7 День назад
As a new grad (working for non system-related program), I have been always wondering how I can always get interested in these types of topics and get more understanding about these topics. How did you learn and improve through your life? I think this is more what I need to become better engineer or programmer to understand what it is exactly happen. Can you give me some advice?
@kimsdo7
@kimsdo7 День назад
To add on, I think recent university has more focus on ML not system so much... I think it is interesting, buuuut, if I understand that correctly. If you really make "new" model to change the world, we should make new equations or algorithms. That part is not fascinating to me to be honest because of the pressure I will get. That is like music or art area in my opinion. I love logics more than probability... So I think I didn't build good start point from university...
@dario.lencina
@dario.lencina 6 часов назад
Hey Kimsdo!! you are making deep questions that require careful and comprehensive responses!! feel free to reach out through discord if you want to talk about this, but here's the simplest answer To the first part of your question "How did you learn and improve to your life?" I always focused on becoming good on the things that: 1. Paid well 2. Nobody wanted to do. This started when iOS came out, all the trolls said that iOS was a toy and that real software only existed on the blackberry... so I focused on iOS. The strategy worked and I was able to get a job at GM because I was among the best iOS developers. Then autonomous vehicles (AVs) came around, nobody wanted to learn because they said that AVs were only hype, and that people will always drive... so I learned about AVs. I was assigned to Cruise Automation a company in California which is among the most advanced companies in the world. Fast forward to 2020, I recognized the value of social media, so I learned. It took me longer to pick it up, but here we are. It took me longer than I wanted to monetize and learn the trade, but now I am increasing my income every month through RU-vid and hopefully helping developers all over the world. Regarding your second question, " If you really make "new" model to change the world, we should make new equations or algorithms." before trying to make new equations, get your ML basics right, understand perceptrons, simple regression, gradient decent, then neural networks. You wont be able to innovate in the field of ML until you understand the basics. lastly, " I love logics more than probability... So I think I didn't build good start point from university..." after you learn ML properly, you'll understand that the world is NOT deterministic, it is probabilistic, and that will help you to think about new models. I sincerely hope that this helped, feel free to reach out on discord to chat some more.
@julesoscar8921
@julesoscar8921 15 часов назад
Are you sure you need to unwind to retrieve the memory?
@dario.lencina
@dario.lencina 13 часов назад
Yes, you do have to unwind the error to **return the memory to the os
@julesoscar8921
@julesoscar8921 12 часов назад
@@dario.lencina I thought the kernel was aware of the memory used by a process, so as soon of the process die, the memory can be retrieve (that why you don't want zombie). But I'm not an expert
@dario.lencina
@dario.lencina 12 часов назад
@@julesoscar8921 I think we are both right, unwinding panics does return the memory to the OS, and also, the OS keeps track of all the memory allocation so it can reclaim all that memory back regardless if you free it or not
@O...Maiden...O
@O...Maiden...O День назад
So, what does this mean? program performance, execution speed, compile time, or...?
@RomanAvdeevX
@RomanAvdeevX День назад
Startup time is a bit slower in rust. It doesn't matter at all
@ClimateChangeDoesntBargain
@ClimateChangeDoesntBargain День назад
perhaps slower startup time (though it's questionable if it's measurable)
@dario.lencina
@dario.lencina 7 часов назад
this ^^
@CrazyWinner357
@CrazyWinner357 16 часов назад
What you said doesnt make sense at all. Rusts memory safety happens in compile time not runtime. And tell me which system call improves safety? You just said bunch of nonsense. And additionally you didn't remove the includes in c code.
@dario.lencina
@dario.lencina 13 часов назад
😄 you are right
@dario.lencina
@dario.lencina 13 часов назад
I love how you judge my assessment without even researching 😆😆
@da40au40
@da40au40 4 часа назад
​@@dario.lencina rust devs are wild candidates u should have known 😂
Далее
How many kernel system calls do runtimes make?
19:18
Просмотров 14 тыс.
Real Programmers Write Machine Code
26:25
Просмотров 111 тыс.
Rust for TypeScript devs : Borrow Checker
8:49
Просмотров 223 тыс.
Is Computer Science still worth it?
20:08
Просмотров 201 тыс.
I switched to Linux 30 days ago... How did it go?
28:46
Why do developers hate Rust?
8:20
Просмотров 121 тыс.
Why Rust is NOT a Passing Fad...
8:54
Просмотров 36 тыс.
The Star Language that will outshine Rust? Gleam
10:33
Why i think C++ is better than rust
32:48
Просмотров 306 тыс.
How A Steam Bug Deleted Someone’s Entire PC
11:49
Просмотров 996 тыс.
Why More People Dont Use Linux
18:51
Просмотров 228 тыс.