0

I was following the tutorial on Magma from the awesome Seaside book and at one point my image got stuck completely. I was in the debugger at that moment and I've tried to run "inspect it" on ToDoDB root part of the following snippet:

ToDoDB createDB.
ToDoDB commit: [ ToDoDB root add: ToDoItem new ].
ToDoDB release.

After that my image stopped responding to anything.

I'm kind of curious why Magma behaved that way on inspect action, but I'm more interested in learning what are my options for fixing this issue? Should I just throw out this image and start from scratch? Can I send some OS signal to the VM to kill the active thread or something? Smalltalk newbie here.

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
Dima Sabanin
  • 118
  • 2
  • 5

2 Answers2

2

Sean has already answered, but you can find it also in the pharo collaborative book: http://book.pharo-project.org/book/TipsAndTricks/InterruptKey/

Just another remark where you say "Can I send some OS signal to the VM to kill the active thread or something? Smalltalk newbie here.". Notice that most Smalltalk dialects have what is called "green thread". That is, that from the OS point of view it is only one thread. Smalltalk inside manages itself the different process and the schedule about it. Check classes like Processor, Scheduler, etc. So...what I am saying that if you want to kill a thread from outside, you will kill the only thread, the whole VM ;)

1

Try sending an interrupt. See http://wiki.squeak.org/squeak/899 for the shortcut for your platform (i.e. underlying OS).

Also, you probably mean "throw out this image" instead of "this VM". Pharo By Example is a great free resource for Smalltalk basics like image vs. changes file vs. VM

Sean DeNigris
  • 6,306
  • 1
  • 31
  • 37
  • Thank you! And thanks for the correction about VM vs image. Already reading Pharo By Example and enjoying it a lot. – Dima Sabanin Apr 25 '11 at 03:55
  • Welcome to the Smalltalk community :) Feel free to also ask questions on the mailing lists, where many of the core developers hang, and are most easily accessed and searched at forum.world.st. world.st is a clearinghouse for all things smalltalk (e.g. books - many free, screencasts). – Sean DeNigris Apr 25 '11 at 16:24
  • 1 of the 2 NYC Smalltalkers named Sean ftw! – Sean T Allen Apr 27 '11 at 04:40