Pointer Data Problem
Posted: Sun Feb 03, 2008 5:18 am
Hi everyone,
I'm having some issues in my thread creation function. Each thread setup needs to increment the parent task pointer's "numchildren" element so that the next thread is placed into the correct location in the address space (ie, stacks and whatnot).
This is the code:
My OS outputs some debugging information related to this problem:
You can see that both addresses are equal (the second address in the pointer = lines is the address of the numchildren element). The "final esp..." line is printed during thread creation (as you can see, two threads are created here).
I've tried setting the pointer as volatile but that doesn't solve anything. Any ideas would be greatly appreciated.
I'm having some issues in my thread creation function. Each thread setup needs to increment the parent task pointer's "numchildren" element so that the next thread is placed into the correct location in the address space (ie, stacks and whatnot).
This is the code:
Code: Select all
parentptr->me->numchildren++;
Code: Select all
process newcntx = 15434d, newentry = 15437b
final esp is 0xe0000fbc
pointer = 15437b/154367, 1 children
pointer = 15437b/154367, 2 children
final esp is 0xe0000fbc
pointer = 15437b/154367, 1 children
pointer = 15437b/154367, 2 children
I've tried setting the pointer as volatile but that doesn't solve anything. Any ideas would be greatly appreciated.