Hi, On 24/03/14 17:56, Alexandre Bergel wrote:
Hi!Threads in Pharo have always been mysterious for me. If I doit the following: [ true ] whileTrue Can other thread interrupt this? Say in other words, can the following piece of code may suffer from a concurrent problem in Pharo anOrderedCollection add: 42 My current understanding about thread is that there is a scheduling that may occurs each time we enter the VM (e.g., primitive call, instantiating an object, throwing an exception). So, the code "anOrderedCollection add: 42” will _never_ suffer from concurrent call because adding 42 to a collection does not enter the VM. Does this make sense?
I don't think so. AFAIK interrupts are checked on message sends and on backward jumps (because of inlined loops just like in your example). So context switch may happen on each send... Jan
What is the current status of this? Thanks to you all Alexandre
