Re: Access thread stack from another thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 5, 2010 at 3:20 PM, Joel Fernandes <agnel.joel@xxxxxxxxx> wrote:
> On Sat, Jun 5, 2010 at 11:14 AM, Vimal <j.vimal@xxxxxxxxx> wrote:
>> On 4 June 2010 17:16, Group <mailforgroup@xxxxxxxxx> wrote:
>>> Hi,
>>>
>>> Is it possible to access threads stack (not shared) from another thread?
>>> I have seen an API which gets the attributes for the stack
>>> pthread_attr_getstack().
>>> But is it possible to access the DATA on the thread stack?. Is there any api
>>> for it?.
>>
>> Since the stack address is just a memory address, so you can
>> dereference it to read values.  If you as a program writer know which
>> function executes on the stack, you could create a struct that reads
>> values off it (integers, strings, floats, etc., instead of just
>> bytes).
>>
>
> Don't think its that simple because note that each thread has is in
> its own address space.

I'm sorry I got confused between processes and threads, you are indeed
correct- threads are processes that share file descriptors, address
space and sighands.

now i have a question, even if they share the same vm address space -
they definitely can't share the userspace stack, i'm sure the kernel
would have to reset it up in the same address space of the group of
threads but I really don't know how that works - could you share your
thoughts on this?

thanks,
-Joel

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux