CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Jeffrey Arulraj

    MemberAug 7, 2013

    Remeber a pile of Coins or a pile of books arranged one over the other That is a really good example of a stack

    In a stack the last placed object can only be taken out at the first time

    That is when you place 10 books one over the other the book on top only can be removed @ the first time though you wish to take the last book This is called stack

    The first question I am not sure about it mate

    In a computer the Main Memory is based on Stack concept I guess
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberAug 7, 2013

    Stack is just a pile with a last in first out mechanism. In computer science, stacks are used quite a lot. The simplest example is functions. When a function calls another function it just put the other function on the top of the stack. So, the top would be executed first.

    As far as the number of stacks is concerned, I dont think there is a limit. I guess it depends on your system's memory.
    Are you sure? This action cannot be undone.
    Cancel
  • rukawa

    MemberAug 7, 2013

    Thak you for your answers. Each process have a stack right? what is it used for and where is it stored?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberAug 7, 2013

    Stack is a logical entity. The computer represent the memory in form of a stack. So, stack is nothing but your memory only. Any as far as I know every thread has a stack.
    Are you sure? This action cannot be undone.
    Cancel
  • rukawa

    MemberAug 7, 2013

    In Mr. Tanenbaum's book "operating systems", he says that processes in UNIX have their memory divided up into 3 segments :

    - the text segment (i.e the program code)
    - the data segment (i.e the variables)
    - the stack segment.

    rfdfgdf

    The stack segment is used for what?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberAug 7, 2013

    Well, the stack segment mainly stores local variables, while the data segment stores global and static variables.
    Are you sure? This action cannot be undone.
    Cancel
  • rukawa

    MemberAug 7, 2013

    In the body of the process's program there are a numbrer of functions. Everytime a function is called, the process uses its stack (I mean the process's stack) to store the parameters and local variables and return addresses, is that true? is the process's stack used fot all the functions of the program?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberAug 7, 2013

    Well, that makes senses. The function shouldn't have it's stack outside process's memory space.
    Are you sure? This action cannot be undone.
    Cancel
  • Nayan Goenka

    MemberAug 7, 2013

    There is nothing like a Computer Stack. We have stacks. It is a data structure which allows you to store arrays of data together in a LIFO format that is Last in first out.

    The number of stacks is not specific. A stack can be of any size and length. If you have doubt any particular stack in any program or you have read about it somewhere and you didnt understand then paste that content here. We will try to explain.
    Are you sure? This action cannot be undone.
    Cancel
  • rukawa

    MemberAug 8, 2013

    The process's program contains functions which may call other functions. When a function calls another function, the address that the called function should return to is stored in the stack. But what exactly is this address :
    - the address of the instruction following the instruction that called the function
    - the address of the instruction that called the function
    - the address of the program itself
    what is it?
    Are you sure? This action cannot be undone.
    Cancel
  • Pensu

    MemberAug 8, 2013

    Option A.....😉
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register