Re:Asynchronous Programming in C#
by neonsunset on Tuesday April 30, 2024 @10:10AM
(#40211118)
Unix is trivial too
unsafe
{
[DllImport("libc", EntryPoint = "write")]
static extern nint Write(nint fd, byte* buf, nint length);
var text = "Hello, World!"u8;
fixed (byte* ptr = text)
{
Write(1, ptr, text.Length);
}
}
About as easy as Python, at least.
Which, for MS, made a lot of sense, they wanted to hook win32 apis. Java doesnt care, as much...