Can cmecab-java handle concurrent transactions?

13 views
Skip to first unread message

Franz Allan Valencia See

unread,
Jan 7, 2010, 3:14:19 AM1/7/10
to cmecab-j...@googlegroups.com
I brought the idea to my colleagues to replace our GoSen with cmecab-java.

One of the issues that was raised was concurrency. Pardon for the really stupid question, but is cmecab-java (or MeCab for that matter) can handle concurrent requests safely?

Looking at the java code of cmecab-java, the analyzer seems to be thread-safe. However, I'm not sure if same can be said for MeCab (or their c++ in between).

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
fran...@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

Kohei TAKETA

unread,
Jan 7, 2010, 7:37:11 AM1/7/10
to cmecab-j...@googlegroups.com
Hello,

Franz Allan Valencia See <fran...@gmail.com>:


> One of the issues that was raised was concurrency. Pardon for the really
> stupid question, but is cmecab-java (or MeCab for that matter) can handle
> concurrent requests safely?

cmecab-java (and underlying MeCab library) is thread-safe as long as
each thread uses different Tagger instance.
It also applies to Tokenizers and Analyzers.

You may think it's too resource-consuming to have multiple tagger
instances, but it's not. MeCab effectively shares dictionary data
between tagger instances.

Regards,
Kohei Taketa

Franz Allan Valencia See

unread,
Jan 12, 2010, 11:12:48 PM1/12/10
to cmecab-j...@googlegroups.com
I see.

Thanks :-)
Reply all
Reply to author
Forward
0 new messages