GSM problem:How to make receive buffer empty using hardware or soft serial

Hello friends,
Task : receiving SMS without interupting other task
library : SoftwareSerial for GSM rx,tx
Problem : 1.In Reading SMS only when it comes and if certain other task is going on msg should store in sim mem and read msg from perticular position.
2.Cant use SerialEvent concept in "softWareserial" library
I have to do certain task after receiving msg from GSM sim900.
i'm not using any library because of more memory usage.this code i'm trying but prints 'Hello"more no. of times if some data comes on serial and i have to perform task only once if som data available

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  if(Serial.available())
    {
      Serial.println("Hello");
      Serial.read(); 
      delay(10000);
    } 
    //other task to be perform
}

Your problem isn't exactly clear, but I think what you need to do is store the incoming characters in a char array until a terminating character is received.

Thanks Dannable..
should i check for +CMTI command and location of storage continuously to read msg?
is there any other effective way using softwareserial library to receive msg from GSM modem? so, that it should not affect other task.

If the msg received and i'm performing another task which takes certain amount of time & again in that task i'm communicating with GSM sending and receiving commands.it may happen that #a1 or#a0 data lost and controller may not work according to received msg.
how to program in this case?