reading file,looping and limitation

I have 2 functions on AIX.
Func_A () {
....
....
}
Func_B () {
....
....
}
And I have a abc.txt file (multiple lines) and I would like to read line by line and pass line by line to Func_A & Func_B.
once Func_A is done,pass same value to Func_B and in the mean time get second line from txt file and pass it to Func_A
and only 4 lines can be active any given moment.

Example
line_1 --> Func_A (done) ---> continue with Func_B (processing)
line_2 --> Func_A (done) ---> continue with Func_B (processing)
line_3 --> Func_A (done) ---> continue with Func_B (processing)
line_4 --> Func_A (done) ---> continue with Func_B (processing)

I want to wait until func_B is done for line_1 before I continue reading the line_5. Please let me know if I am not explain well?

Appreciate all the help in advance. Thanks

You can start from this:

while read line
do
  Func_A $line
  Func_B $line
done <abc.txt

Thanks. Reading a file is not an issue. I can't straighten up the logic, how can I read second line while first line is working on Func_B and how can I limit 4 lines?

Thanks.

If you can't straighten the logic and you can't straighten the function, what are you allowed to change?

What I meant was, I can't figure out how to handle read of second line while working on first line (Func_B is still processing line_1) and limit them at 4.

Use a control variable:

controlVar=1
while read line
do
	if [ ${controlVar} -eq 1 ]
	then
		Func_A "${line}"
	elif [ ${controlVar} -eq 2 ]
	then
		Func_B "${line}"
	elif [ ${controlVar} -eq 3 ]
	then
		Func_C "${line}"
	elif [ ${controlVar} -eq 4 ]
	then
		Func_D "${line}"
		controlVar=1
	fi
	controlVar=`expr ${controlVar} + 1`
done <abc.txt

EDIT: Sorry, after I posted I read the topic carefully!

I could not understand what the OP wants!