What is the problem with this Busy Wait solution for two threads?
Your approach works fine providing assignment operations are atomic. But I cannot see any concurrency in your approach. $P_2$ always waits until $P_1$ produces and reaches the upper limit, for example until it completely fills the buffer. Then it triggers $P_2$ to consume and waits until $P_2$ consumes all items, for example empties the buffer. So the algorithm can be rewritten as 

doStuff()
  loop-forever 
    produce(F) # N items
    consume(F) # N items
  end
end


In fact the consumer(s) consumes as soon as the producer(s) produces items. In this case you would have to use synchronizations techniques such as mutexes.

Also (from here)


  The producer–consumer problem, particularly in the case of a single producer and single consumer, strongly relates to implementing a FIFO or a channel.


So there is no point to try and use a concurrent algorithm for this problem.  But if your model is multi producer/consumer model then your approach may lead to the race condition.