Handlebars.Net icon indicating copy to clipboard operation
Handlebars.Net copied to clipboard

Static Handlebars instance thread safety

Open RohanChhipa opened this issue 4 years ago • 2 comments

Hi ☺️

Regarding the static instance of handlebars, is it possible to observe blocking behaviour when that instance is accessed with multiple threads?

During our load test for our web API, we're seeing some Compiles going through while some aren't. We're actually looking into possibly creating a new instance for each request that comes through but also just wanted to have a forum around whether or not there have been multi-threading issues with the static instance.

RohanChhipa avatar Nov 09 '21 19:11 RohanChhipa

Hello @RohanChhipa I'm not aware of any such issues. I'd be happy to help you with the investigation and fixing the problem if one found.

Btw, why are you doing Compile on each request? This operation is pretty expensive. Have you thought on reusing compiled templates?

oformaniuk avatar Nov 09 '21 20:11 oformaniuk

Might be related to https://github.com/Handlebars-Net/Handlebars.Net/issues/498

oformaniuk avatar Mar 04 '22 08:03 oformaniuk