Named Queries VARCHAR Error

Does this not still use the tag threads? (not sure what the technical term is for them). When calling from the library it still takes the same amount of time whether it's defined outside and called or defined inside and called correct?

My understanding is that the tag fires off the script from the library and lets go.

Phil has posted on this sort of issue many times. Here's one related post: Tag change script thread mode - #2 by pturmel.

1 Like

Yes. Calling a library function doesn't change what thread is running. It's just a library. If from a tag event, it is still using the limited thread pool. If from a gateway tag change event, it is still occupying that one dedicated thread.

1 Like

No. You might be confusing libraries with the technique I recommend in this topic:

Using queueUtil does push the work out of the tag event thread pool.

2 Likes

I'm not suggesting you call it from a tag script, but from the gateway event.
You shouldn't put too much code in a gateway event, or you'll run into weird scoping behavior. So write your script as a library function where you won't have those issues.

1 Like