When sharing Static Variables between a Trigger Context and an Async Operation such as Batch Apex, is it possible for there to be a conflict between the two? For example, say I have a Trigger that does some processing on some data, but if that dataset is too large, I default to a Batch Class that does the same operation, but limits the amount of data within the context. To reduce code overhead, a helper class is created with Static Variables and code that can be referenced from both the Trigger, and the Batch Apex contexts.
Now lets say that the Trigger is executed again immediately after executing Batch Apex. What would be the consequences of the Trigger firing while the Batch Apex job is running?
Is it possible that one of these processes could overwrite data in a Static Variable set by the other, or do they have two separate instances that execute in different threads?