Where does process preemtion takes place?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Where does process preemtion takes place?

Guillermo Polito
Hi!

I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...

Can someone point me a place?

Tx,
Guille

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Where does process preemtion takes place?

Bert Freudenberg

On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:

> Hi!
>
> I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
>
> Can someone point me a place?

It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).

- Bert -

PS: no need to send a mail to both vm-dev and vm-beginners :)

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Where does process preemtion takes place?

Guillermo Polito
But somehow if I run

[ [true] whileTrue: [ Transcript show: 'asd'; cr.] ] fork.

It gets preempted while it is running, and It does not make any yield...

On Mon, Dec 10, 2012 at 4:17 PM, Bert Freudenberg <[hidden email]> wrote:

On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:

> Hi!
>
> I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
>
> Can someone point me a place?

It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).

- Bert -

PS: no need to send a mail to both vm-dev and vm-beginners :)

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Where does process preemtion takes place?

Bert Freudenberg

On 2012-12-10, at 16:39, Guillermo Polito <[hidden email]> wrote:

> But somehow if I run
>
> [ [true] whileTrue: [ Transcript show: 'asd'; cr.] ] fork.
>
> It gets preempted while it is running, and It does not make any yield...

You did not ask about user interrupt handling specifically before. "Preempting" means any suspending of a lower-priority process by a higher-priority one.

Pressing the interrupt key sets the interruptPending flag, which signals TheInterruptSemaphore (see checkForInterrupts). This resumes the interrupt watcher process.

- Bert -

>
> On Mon, Dec 10, 2012 at 4:17 PM, Bert Freudenberg <[hidden email]> wrote:
>
> On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:
>
> > Hi!
> >
> > I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
> >
> > Can someone point me a place?
>
> It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).
>
> - Bert -
>
> PS: no need to send a mail to both vm-dev and vm-beginners :)
>
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: Where does process preemtion takes place?

Guillermo Polito
Nope, I mean preempting. When my process has the priority and is the active process, it gets preempted by higher priority processes. But my process does not make any #yield.

On Mon, Dec 10, 2012 at 5:21 PM, Bert Freudenberg <[hidden email]> wrote:


On 2012-12-10, at 16:39, Guillermo Polito <[hidden email]> wrote:

> But somehow if I run
>
> [ [true] whileTrue: [ Transcript show: 'asd'; cr.] ] fork.
>
> It gets preempted while it is running, and It does not make any yield...

You did not ask about user interrupt handling specifically before. "Preempting" means any suspending of a lower-priority process by a higher-priority one.

Pressing the interrupt key sets the interruptPending flag, which signals TheInterruptSemaphore (see checkForInterrupts). This resumes the interrupt watcher process.

- Bert -

>
> On Mon, Dec 10, 2012 at 4:17 PM, Bert Freudenberg <[hidden email]> wrote:
>
> On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:
>
> > Hi!
> >
> > I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
> >
> > Can someone point me a place?
>
> It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).
>
> - Bert -
>
> PS: no need to send a mail to both vm-dev and vm-beginners :)
>
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
>




_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: Where does process preemtion takes place?

Bert Freudenberg

On 2012-12-10, at 18:44, Guillermo Polito <[hidden email]> wrote:

> Nope, I mean preempting. When my process has the priority and is the active process, it gets preempted by higher priority processes. But my process does not make any #yield.

Okay. This still happens in checkForInterrupts, which gets called on a backwards jump (like in your while loop, see #longUnconditionalJump) and on various other occasions, like on message sends.

- Bert -


> On Mon, Dec 10, 2012 at 5:21 PM, Bert Freudenberg <[hidden email]> wrote:
>
>
> On 2012-12-10, at 16:39, Guillermo Polito <[hidden email]> wrote:
>
> > But somehow if I run
> >
> > [ [true] whileTrue: [ Transcript show: 'asd'; cr.] ] fork.
> >
> > It gets preempted while it is running, and It does not make any yield...
>
> You did not ask about user interrupt handling specifically before. "Preempting" means any suspending of a lower-priority process by a higher-priority one.
>
> Pressing the interrupt key sets the interruptPending flag, which signals TheInterruptSemaphore (see checkForInterrupts). This resumes the interrupt watcher process.
>
> - Bert -
>
> >
> > On Mon, Dec 10, 2012 at 4:17 PM, Bert Freudenberg <[hidden email]> wrote:
> >
> > On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:
> >
> > > Hi!
> > >
> > > I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
> > >
> > > Can someone point me a place?
> >
> > It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).
> >
> > - Bert -
> >
> > PS: no need to send a mail to both vm-dev and vm-beginners :)
> >
> > _______________________________________________
> > VM-beginners mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
> >
>
>
>
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Re: Where does process preemtion takes place?

Guillermo Polito

On Mon, Dec 10, 2012 at 6:55 PM, Bert Freudenberg <[hidden email]> wrote:

On 2012-12-10, at 18:44, Guillermo Polito <[hidden email]> wrote:

> Nope, I mean preempting. When my process has the priority and is the active process, it gets preempted by higher priority processes. But my process does not make any #yield.

Okay. This still happens in checkForInterrupts, which gets called on a backwards jump (like in your while loop, see #longUnconditionalJump) and on various other occasions, like on message sends.

Great! Thank you very much!!
 

- Bert -


> On Mon, Dec 10, 2012 at 5:21 PM, Bert Freudenberg <[hidden email]> wrote:
>
>
> On 2012-12-10, at 16:39, Guillermo Polito <[hidden email]> wrote:
>
> > But somehow if I run
> >
> > [ [true] whileTrue: [ Transcript show: 'asd'; cr.] ] fork.
> >
> > It gets preempted while it is running, and It does not make any yield...
>
> You did not ask about user interrupt handling specifically before. "Preempting" means any suspending of a lower-priority process by a higher-priority one.
>
> Pressing the interrupt key sets the interruptPending flag, which signals TheInterruptSemaphore (see checkForInterrupts). This resumes the interrupt watcher process.
>
> - Bert -
>
> >
> > On Mon, Dec 10, 2012 at 4:17 PM, Bert Freudenberg <[hidden email]> wrote:
> >
> > On 2012-12-10, at 14:22, Guillermo Polito <[hidden email]> wrote:
> >
> > > Hi!
> > >
> > > I was looking at the process machinery in VMMaker and I can't find where the preemption of processes takes place...
> > >
> > > Can someone point me a place?
> >
> > It happens in #transferTo:. This is called whenever a process is resumed because a semaphore got signaled (in which case the process that was waiting on the semaphore is resumed) or if the process stops working because of a wait / yield / suspend call (in which case #wakeHighestPriority determines the next process).
> >
> > - Bert -
> >
> > PS: no need to send a mail to both vm-dev and vm-beginners :)
> >
> > _______________________________________________
> > VM-beginners mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
> >
>
>
>
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners