In this video I will demonstrate how memory mapped files can be used to share memory between processes by making a simple local chat example Code: github.com/nir...
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 UA-cam 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.
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.
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!
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
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?
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
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 UA-cam 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.
Thanks, I appreciate this :)
I've known mmap for a long time, but not understand the practical use of it. Thanks for the tutorial.
mmap in windows is VirtualAlloc, not a mapped file
Thanks, currently learning this in my OS class, but it's super insightful and useful to see someone program it.
high quality content congrats👏👏
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.
This was so well explained thank u man
Next video: Making a simple GPT-4 AI in C on Windows
😂 "Minimalist" AI
xD@@nirlichtman
AI that predicts the age based on an input age
Great work, I loved it
I'd love to see the Linux equivalent of this
on linux. pipe/socket is the only way
mmap has an fd parameter that lets you map a file into memory
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!
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
@@nirlichtman Thanks Nir, excellent content!
Love the simplicity!
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?
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
NIce.
Very high quality, I think I have got lost 😅
Why not using 'nc' ?
The idea is to demonstrate how to work with shared memory on Windows
@@nirlichtman it was very neat 👍🏻
Please make another tutorials about WinAPI
More Win32 vids are planned :)
More assembly please
More Assembly planned :)