Are NIF resources meant to be destroyed immediately on GC?

Sean Hinde sean.hinde@REDACTED
Wed Nov 25 19:25:26 CET 2020


>> I agree. My use case for this was building a nif for the oracle oci bindings.
> 
> Uhm... But this is exactly what ports are supposed to handle and it's
> exactly how they work. Why shoehorning NIFs here?

For sure we could have used a port. I think some earlier version of the library used a port.

NIFs involve a whole lot *less* shoehorning though - the programming model of NIFs is really so much nicer than all the complexity of building a multithreaded port program. Why write all your own when dirty NIFs are so beautiful.

Sean

> 
> -- 
> Stanislaw Klekot



More information about the erlang-questions mailing list