Shop OBEX P1 Docs P2 Docs Learn Events
Multitasking with threads on different pages — Parallax Forums

Multitasking with threads on different pages

darcodarco Posts: 86
edited 2007-12-28 16:43 in General Discussion
I'm trying to use the poppc and pushpc instrstructions to implement preemptive multitasking. I've gotten it working fairly well, as long as the threads are on the same page. It seems as though it just doesent matter what is in the M register, the only part of the return vector that is changed is the lower eight bits. I've tried every way I can think of to make sure that M is set properly before calling pushpc, but nothing seems to make it actually change the page of the return vector.

This makes the utility of threading rather limited if I must keep all threads on the same page. Anyone have any ideas? Are there any gotchas that I could be missing?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

darco
www.deepdarc.com/

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-12-27 21:36
    We can't do much without code.

    regards peter
  • darcodarco Posts: 86
    edited 2007-12-28 16:43
    I think I figured out what was wrong. When I was initializing the thread, I was only setting the program counter, but not updating the page on the status register. The result was a page change whenever the new thread hit a goto.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    darco
    www.deepdarc.com/
Sign In or Register to comment.