Windows API Memory Mapped Files Explained

  Рет қаралды 8,327

Nir Lichtman

Nir Lichtman

Күн бұрын

Пікірлер: 35
@theoriginalneckbeard
@theoriginalneckbeard 11 ай бұрын
Hey, Nir. I wanted to thank you, simply because you're my favorite programming related channel right now and make me having hope in serious, high quality and non click-bait-y content on KZbin again. Its informational and educational, quality over quantity and I appreciate exactly this in these days and times, where most channels point their focus on generating the most possible traffic through being striking and superficial.
@nirlichtman
@nirlichtman 11 ай бұрын
Thanks, I appreciate this :)
@minnoxzmozzesmx8915
@minnoxzmozzesmx8915 11 ай бұрын
I've known mmap for a long time, but not understand the practical use of it. Thanks for the tutorial.
@itsdrdy5551
@itsdrdy5551 11 ай бұрын
mmap in windows is VirtualAlloc, not a mapped file
@jorgerias262
@jorgerias262 11 ай бұрын
Thanks, currently learning this in my OS class, but it's super insightful and useful to see someone program it.
@oracleoftroy
@oracleoftroy 11 ай бұрын
This seems like it has some pretty serious race conditions. Without knowing exactly what the guarantees for the shared condition variable are in windows off the top of my head, I think you would want to not autoreset so that the file won't be written to while you are reading it, and only reset once the read is finished. And you probably want to make sure it is false before the server writes new data,.. assuming we want every write to be followed by a read. (Something else would need to be done otherwise.) Still, pretty neat seeing how easy it is to set this up. I haven't needed something quite like this before and didnt realize that it doesn't take much code ro get it working.
@rian0xFFF
@rian0xFFF 11 ай бұрын
Next video: Making a simple GPT-4 AI in C on Windows
@nirlichtman
@nirlichtman 11 ай бұрын
😂 "Minimalist" AI
@holiamusic
@holiamusic 11 ай бұрын
xD@@nirlichtman
@ngokhanh7291
@ngokhanh7291 11 ай бұрын
AI that predicts the age based on an input age
@guilhermebonato4074
@guilhermebonato4074 2 ай бұрын
is possible to make a Lit in processes a and send to processes b in memori ?
@harunsarpnar3428
@harunsarpnar3428 11 ай бұрын
high quality content congrats👏👏
@angelffg
@angelffg 11 ай бұрын
Excellent video! Nir, does this apply to applications between 2 or more computers on an internal network or does it only work for communication between programs on the same computer? Thanks for supporting!
@nirlichtman
@nirlichtman 11 ай бұрын
Thanks! It only works for communication between programs on the same computer, I mostly used this example to demonstrate basic usage of memory mapped files
@angelffg
@angelffg 11 ай бұрын
@@nirlichtman Thanks Nir, excellent content!
@jmvr
@jmvr 3 ай бұрын
I'd assume that if you want communication between multiple computers, you'd want to look into the WinSock2 API, or similar networking APIs.
@angelffg
@angelffg 3 ай бұрын
@@jmvr Thanks 🙌🏻
@Pipe0481
@Pipe0481 11 ай бұрын
I'd love to see the Linux equivalent of this
@ryonagana
@ryonagana 11 ай бұрын
on linux. pipe/socket is the only way
@dimi144
@dimi144 11 ай бұрын
mmap has an fd parameter that lets you map a file into memory
@ISAK.M
@ISAK.M 9 ай бұрын
This was so well explained thank u man
@chuckhaatvedt7515
@chuckhaatvedt7515 28 күн бұрын
Nir, could you expand on this example to show two way communication between the server and client ? thanks, this is very informative
@nirlichtman
@nirlichtman 25 күн бұрын
One way to implement two way communication is to CreateThread on both the server and client and then you can have the thread listen on an event and read the message when triggered
@3bdo3id
@3bdo3id 10 ай бұрын
Great work, I loved it
@thisisnotok2100
@thisisnotok2100 11 ай бұрын
Very cool. I've had an interest in how vpn clients "hijack" traffic to encrypt and reroute it to the the VPN server. Could you do a simple demonstration of an application that does something like this?
@nirlichtman
@nirlichtman 11 ай бұрын
Thanks! Could you give an example about this? I am pretty sure the VPN clients just work by changing the network settings on the computer and set up the traffic to go through the VPN server
@GooogleGoglee
@GooogleGoglee 11 ай бұрын
Very high quality, I think I have got lost 😅 Why not using 'nc' ?
@nirlichtman
@nirlichtman 11 ай бұрын
The idea is to demonstrate how to work with shared memory on Windows
@GooogleGoglee
@GooogleGoglee 11 ай бұрын
@@nirlichtman it was very neat 👍🏻
@EnLopXf
@EnLopXf 11 ай бұрын
Please make another tutorials about WinAPI
@nirlichtman
@nirlichtman 11 ай бұрын
More Win32 vids are planned :)
@maartenofbelgium
@maartenofbelgium 11 ай бұрын
Love the simplicity!
@Kheir2
@Kheir2 10 ай бұрын
More assembly please
@nirlichtman
@nirlichtman 10 ай бұрын
More Assembly planned :)
@justinnamilee
@justinnamilee 11 ай бұрын
NIce.
Making Minimalist Web Server in C on Windows
10:52
Nir Lichtman
Рет қаралды 11 М.
Making Smallest Possible Linux Distro (x64)
27:43
Nir Lichtman
Рет қаралды 35 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
How To View Process Memory On Windows
25:55
Nathan Baggs
Рет қаралды 6 М.
CS 134 OS-7: Memory-Mapped Files
6:03
Neil Rhodes
Рет қаралды 31 М.
What's Virtual Memory? - Computerphile
22:40
Computerphile
Рет қаралды 181 М.
Zig for the Uninitiated: Pointers, Arrays, and Slices
19:03
Tyler Calder
Рет қаралды 4,2 М.
Creating a window - Software from Scratch
1:04:12
Muukid
Рет қаралды 181 М.
The purest coding style, where bugs are near impossible
10:25
Coderized
Рет қаралды 1 МЛН
Every Programming Language Ever Explained in 15 Minutes
15:29
Flash Bytes
Рет қаралды 368 М.
How to Map Files into Memory in C (mmap, memory mapped file io)
4:47
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 1,1 МЛН
The Importance of Resource Cleanup in C
7:02
Nir Lichtman
Рет қаралды 7 М.