Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!novia!posts.news.sonic.net!nnrp1.nntp.sonic.net!not-for-mail Message-ID: <51C8CF7B.2090106@bitblocks.com> Date: Mon, 24 Jun 2013 16:00:11 -0700 From: Bakul Shah User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Thunderbird/22.0 MIME-Version: 1.0 Newsgroups: comp.arch.fpga Subject: Re: New soft processor core paper publisher? References: <4205b3b0-b16f-41d2-b322-2567c99a2060@googlegroups.com> <2d8b1141-56df-4302-b9a6-9fba50b319f1@googlegroups.com> <78e9d514-f501-494d-942c-38d51e8a2f1d@googlegroups.com> <1vSxt.75699$Vq3.26601@fx05.am4> <51C8C23A.10904@bitblocks.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 17 Organization: Sonic.Net NNTP-Posting-Date: 24 Jun 2013 23:00:11 GMT NNTP-Posting-Host: 1ffdb1c4.news.sonic.net X-Trace: DXC=e:kR5T:WFOj0fefh5dZ5n`m4K\QM1CV^`1OYf0H`?;XaJil0:FNo0LiSlSKhVo7F[n2TRc>i@QEk` X-Complaints-To: abuse@sonic.net Xref: csiph.com comp.arch.fpga:4906 On 6/24/13 3:23 PM, Eric Wallin wrote: > On Monday, June 24, 2013 6:03:38 PM UTC-4, Bakul Shah wrote: > >> Consider a case where *both* thread A and B want to increment >> a counter at location X? A reads X and finds it contains 10. But >> before it can write back 11, B reads X and finds 10 and it too >> writes back 11. Now you've lost a count. Can this happen in your >> design? If so you need some sort of atomic update instruction. > > It can happen if the programmer is crazy enough to do it, otherwise not. Concurrent threads need to communicate with each other to cooperate on some common task. Consider two threads adding an item to a linked list or keeping statistics on some events or many such things. You are pretty much required to be "crazy enough"! Any support for mutex would simplify things quite a bit. Without atomic update you have to use some complicated, inefficient algorithm to implement mutexes.