tag:blogger.com,1999:blog-29331675.post1697148095489996471..comments2024-03-05T17:37:00.995+01:00Comments on The Delphi Geek: Data-driven Multithreadinggabr42http://www.blogger.com/profile/06903558857617342477noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-29331675.post-35562613438529763912019-09-28T11:07:34.106+02:002019-09-28T11:07:34.106+02:00You could, for example, create one output queue pe...You could, for example, create one output queue per client and include it into the request data. DB worker thread would then fetch a request, process it, and write the output to the queue reference from the request record.<br /><br />BTW, a better place for such discussions is https://en.delphipraxis.net/forum/32-omnithreadlibrary/gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-24068667380806731032019-09-27T21:53:21.179+02:002019-09-27T21:53:21.179+02:00Hello
Thank you for this article and your book (D...Hello<br /><br />Thank you for this article and your book (Delpi High Performance). I am using them to guide myself into parallel processing.<br /><br />I am using your code to implement a queued database worker thread. When I send a query to the input queue, and the output queue signals a result, I want to be sure I get the results of my query and not somebody else's query. I can include an identifier to tag my results, but if I receive a result that is not mine, that result set is already popped and no one else will get a chance to examine it. <br /><br />I could send the result back to to output queue if I don't want it, and let the output queue re-signal. I run the risk of re-examining the same result repeatedly until the result I want appears.<br /><br />I could possibly try to peek at the result before I pop it, but that seems to be moving away from the spirit of your code. <br /><br />Do you have thoughts on how I might solve this problem?<br /><br />Thanks<br /><br />DavidDUzzellhttps://www.blogger.com/profile/02425849854356878268noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-33706254329478633762018-02-14T18:22:40.469+01:002018-02-14T18:22:40.469+01:00Might be affiliated to Alice...Might be affiliated to Alice...Unknownhttps://www.blogger.com/profile/15440987979929446334noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-1639716651491764572018-02-14T15:59:33.963+01:002018-02-14T15:59:33.963+01:00Who is Gary?Who is Gary?Stefan Glienkehttps://www.blogger.com/profile/05509404049325709406noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-46112936864734676412018-02-14T13:11:55.303+01:002018-02-14T13:11:55.303+01:00Man, why is this thread stuff still hard? :-/Man, why is this thread stuff still hard? :-/Leushttps://www.blogger.com/profile/01120251632037450037noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-62849735340922560932018-02-14T10:34:38.720+01:002018-02-14T10:34:38.720+01:00Hi,
Thank you for this article. Nice one.
I read...Hi, <br />Thank you for this article. Nice one.<br /><br />I read Gary's article, and I was a bit confused too, mainly for 2 reasons : <br />- Same as your article exposed (Utility of one to one)<br />- And for the fact that current implementation let developper to easely exposed to hard concurrency problem, in a "bad use" case. It is *very easy* to obtain there. <br />I like much Gary's article usually, hope he'll post a more advanced implementation later.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-26727036127928642732018-02-14T00:14:20.973+01:002018-02-14T00:14:20.973+01:00Yes, a multiple producer, multiple consumer queue ...Yes, a multiple producer, multiple consumer queue that is event driven and self contained, is the solution to many threading applications. Once you learn how to express your multitasking problem into those terms, the rest is much easier.<br /><br />Using TThreadedQueue brings back the horrors of the TMonitor bugs in the early generic versions, that made my implementation of a similar framework using TThreadedQueue fall flat on the ground. It was finally fixed in XE2 update 4.<br /><br />Thanks for a well written article. LU RDhttps://www.blogger.com/profile/02076671040899477689noreply@blogger.com