deque & threads 
Author Message
 deque & threads

Is it safe to push_back to a deque in one thread and pop_front in another at
the same time. So one thread would be spinning around pushing stuff into the
deque, whilst another would spin whilst size() > 0 popping off the front?

Regards to all

Andrew JM Hall



Sun, 10 Apr 2005 00:48:15 GMT  
 deque & threads


Quote:
> Is it safe to push_back to a deque in one thread and pop_front in
another at
> the same time. So one thread would be spinning around pushing stuff
into the
> deque, whilst another would spin whilst size() > 0 popping off the

front?

No, it's not safe. You are responsible for appropriate synchronization.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Sun, 10 Apr 2005 00:59:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Thread safety of deque?

2. Client Server && Threads

3. Interprocess Communication && Multiple threads of execution

4. ProcessThread & Thread

5. C & thread problem

6. Threading & Serialization

7. Event driven & Mul threads

8. ANSI C & Threads

9. thread & semaphore

10. JET & multi-threads

11. DAO & Threads

12. custom event&thread + actx HWND problems

 

 
Powered by phpBB® Forum Software