How to use stanford parser with threads?

You can't do anything, except run several processes. The Stanford Parser is not thread-safe.

You can use ThreadLocal. It allows you to keep one instance of parser per thread. Thus any created instance of parser will never be used from more than one thread.

Usually it shouldn't create more instances than CPUs*cores you have. For me it is ~4-5 instances (if I disable Hyper Threading on my quadcore). P.S.Not related to StanfordNLP.

Sometimes poor class implementations contain static fields and modify them in non-thread safe way. General safe parallelization approach for such implementations would be: move computation part into separate process; launch (CPUs*cores) number of processes with computations. Use IPC technic for communicating between main/background processes.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions