SMILE thread safety

175 views
Skip to first unread message

Devlin McGregor

unread,
Nov 15, 2013, 5:00:05 PM11/15/13
to smile-forma...@googlegroups.com
Hello,

Is SmileFactory thread safe? I want to create a single instance and reuse it.
Same question on ObjectMapper

Thanks

Tatu Saloranta

unread,
Nov 15, 2013, 10:19:27 PM11/15/13
to smile-forma...@googlegroups.com
I assume this refers to Jackson Smile module (mailing list covers all Smile implementations, although I haven't seen discussion regarding other impls)

Yes, to both. SmileFactory is safe without any ifs or buts.
ObjectMapper is safe as long as you construct and configure it first, before any use, and do not call configuration methods afterwards.
Note that you can configure serialization and deserialization via thread-safe ObejctReaders and ObjectWriters.

-+ Tatu +-
 


--
You received this message because you are subscribed to the Google Groups "smile-format-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smile-format-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Devlin McGregor

unread,
Nov 15, 2013, 10:45:42 PM11/15/13
to smile-forma...@googlegroups.com
Thanks for the quick reply.

Just one last question, I configured Smile based on the example on github using jackson-dataformat-smile 2.2.3 and jackson-mapper-asl 1.8.5..

SmileFactory f = new SmileFactory();
ObjectMapper mapper = new ObjectMapper(f);

But org.codehaus.jackson.map.ObjectMapper comes back unresolved using those versions; am I using the wrong dependencies?
To unsubscribe from this group and stop receiving emails from it, send an email to smile-format-discussion+unsub...@googlegroups.com.

Tatu Saloranta

unread,
Nov 15, 2013, 11:28:24 PM11/15/13
to smile-forma...@googlegroups.com
Jackson major versions must match: so either use smile module version 1.x with 1.x mapper, or upgrade ObjectMapper. Actually for modules, the minor version should also match that of mappers, so either use 1.8.5 version for Smile module, or upgrade to jackson-databind 2.2.3.
(even better -- 2.3.0 was just released yesterday!)

-+ Tatu +-



To unsubscribe from this group and stop receiving emails from it, send an email to smile-format-disc...@googlegroups.com.

Devlin McGregor

unread,
Nov 18, 2013, 4:54:27 PM11/18/13
to smile-forma...@googlegroups.com
Jackson Data bind is latest and greatest version of SMILE? That's what you recommend?

Tatu Saloranta

unread,
Nov 18, 2013, 5:03:34 PM11/18/13
to smile-forma...@googlegroups.com
Right, Jackson's Smile module is the standard Java implementation.
For other platforms, there is libsmile; I have heard of an iOS version being developed but I don't have a link handy.

-+ Tatu +-



On Mon, Nov 18, 2013 at 1:54 PM, Devlin McGregor <devlin...@gmail.com> wrote:
Jackson Data bind is latest and greatest version of SMILE? That's what you recommend?

Reply all
Reply to author
Forward
0 new messages