Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread and Serialize/De-Serialize  RSS feed

 
Alex Givant
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We has bunch of classes that need to be serialize/de-serialize and some of them contains reference to Thread object.
My question is: should those refernces to be 'transient' or Thread object could be safely serialize/de-serialize.
If it should be 'transient', what is the way to restore and re-run these threads after object has been de-serialized? Should I use Externalizable interface instead of Serializable to create and create methods readExternal()/writeExternal() to deal with Thread objects.
Any advice/tip/link will be highly appriciated.
 
Alex Givant
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found answer myself: Thread class doesn't implement Serializable, so it should be 'transient'.
 
c yb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
up
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alex Givant:
what is the way to restore and re-run these threads after object has been de-serialized?

That entirely depends on what the Threads were doing...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!