Closed pyalex closed 2 years ago
This GIL stuff is out of my limited python expertise but I assume you've tested, and this is easily disabled if there are problems, so I'll merge. Does it impact performance?
Hi @rcoreilly, as my previous PR this was as well tested within feast
first. We have set of end-to-end tests that relies on this functionality and we also published at least two releases with this code and haven't heard complains so far.
I'm not sure what you referring to regarding performance. GIL doesn't impact Go code in any way except blocking parallel Python code execution.
Great! I was just wondering about the overhead of those save / restore calls which weren't otherwise being called..
When python callback is passed as an argument to a Go code, it's expected to work from any subsequently created go routine. Unfortunately, that's currently impossible due to GIL acquired and hold by the main go thread (in which Go was initially called).
This PR adds GIL release logic to the function generator. Before stepping into Go code, GIL will be released and then reacquired back.
Signed-off-by: Oleksii Moskalenko moskalenko.alexey@gmail.com