This is the best explanation I've seen so far. Straight to the point NICE
@oleholgerson3416
2 жыл бұрын
thank you so much for your videos!
@mikgol81
2 жыл бұрын
You're like the Clint Eastwood of programmers
@rosarioscavo6791
3 жыл бұрын
Great explanation!
@zeeshanparvez5235
Жыл бұрын
Amazing explanation
@miladin4023
3 жыл бұрын
Neil thank you so much for this!
@NeilRhodesHMC
3 жыл бұрын
Happy to provide it.
@MrXperx
2 жыл бұрын
very nice professor
@JulienBertozzi
3 жыл бұрын
Thanks !
@federicopueblalarregle5791
9 ай бұрын
I understand that you can optionally `msync` your write if you want to ensure it's written back to disk, but as you mentioned otherwise is up to the kernel to decide when to write it back to disk. For this same reason, I understand that database engines try to avoid `mmap` since it could result in dirty writes or write before a transaction completes (if the kernel decides to write back to disk). Do you know what alternatives do they have to map files to memory without having to worry on the kernel writing them back to disk when the engine doesn't want to yet? Thanks in advance.
@sword013
3 жыл бұрын
Sir how is this faster than directly writing onto the file on disk ? Here you page it in, then write on physical memory and then it eventually has to write back in disk, so how is this faster ? Sorry if this is a dumb question and I understand the queuing part but, in both cases, you need to move the disk read/write heads which is going to take up time. So ain't this more indirect and should take more time ?
@NeilRhodesHMC
3 жыл бұрын
The only speed increase is due to the fact that changes to the file don't require a system call. However, you're right that the pages need to be both read in and written out whether or not the file is memory-mapped. It provides a different interface for the application that may be more convenient. It can sometimes reduce the amount of copying that's done as well.
@maboesanman
2 жыл бұрын
There are other benefits, like for example if you mount the file to the same address space every time, you can store self referential pointers directly in a file, and they’ll stay valid on subsequent loads of the file
@tsunghan_yu
2 жыл бұрын
Does mmap increase a process' address space? If not, which segment is it stored in the memory?
@NeilRhodesHMC
2 жыл бұрын
There's a flat address space and mmap must map somewhere within that address space. Before the mapping, trying to access memory at that address will cause a page fault (assuming it's unmapped). Afterwards, access will succeed.
@AugerHybrid
3 жыл бұрын
Thanks for helping me on my programming course! Did you really write that all on glass and mirrored the video?
@NeilRhodesHMC
3 жыл бұрын
Yes. See kzitem.info/news/bejne/tGOoqnxqiGd0pn4 for a "Making of" video that shows the process in detail.
@lucassivolella
2 жыл бұрын
@@NeilRhodesHMC Loved this video format!
@nexa7606
Жыл бұрын
5head
@dingxu4557
2 жыл бұрын
If only there were Chinese subtitles
@esmanlitebriz
3 жыл бұрын
hey uncle where does your voice coming from?I cant hear anything..pfff.lol
Пікірлер: 21