Re: How can it be both Blocking and Async?

Alexei Kaigorodov via Concurrency-interest <[email protected]>
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <[email protected]>
/How can it be both Blocking and Async?/
Good question.
Consider a thread attempting to perform BlockinQueue#take(). Its algorithm
is blocked, In contrary to BlockinQueue#poll, where the algorithm is not
blocked. 
Note the hardware processor is not blocked - the thread just leaves it. 
So "blocking" means algorithm blocking and not blocking of underlying
processor.
In asynchronous case, if a task cannot get required data, it leaves the
working thread. The working thread (usually taken from a thread pool) is not
blocked. This is similar to the sync case, only the role of processor is
played by the working thread. Since the algorithm is blocked, we call this
asynchronous case blocking.



--
Sent from: http://jsr166-concurrency.10961.n7.nabble.com/
_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.