tag:blogger.com,1999:blog-29331675.post1372651519270582744..comments2024-03-05T17:37:00.995+01:00Comments on The Delphi Geek: OmniThreadLibrary Documentation–an Outlinegabr42http://www.blogger.com/profile/06903558857617342477noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-29331675.post-66675352608230661022012-02-04T20:45:35.286+01:002012-02-04T20:45:35.286+01:00Warren, great & thanks!Warren, great & thanks!gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-15877224852721650992012-02-04T17:21:51.658+01:002012-02-04T17:21:51.658+01:00I am willing to help with the glossary. I'm ...I am willing to help with the glossary. I'm a native english speaker and Delphi guy.<br /><br />Warren<br />warren dot postma at the usual google mail stuffWarrenhttps://www.blogger.com/profile/04053407632823479165noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-87708221005395126892012-02-03T17:02:49.041+01:002012-02-03T17:02:49.041+01:00It's what some of my friends were looking for ...It's what some of my friends were looking for to get some more deep use of OTL.<br />Thanks!EMBnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-44551088929588025472012-02-03T08:58:41.747+01:002012-02-03T08:58:41.747+01:00I have included your notes in the Wiki (http://otl...I have included your notes in the Wiki (http://otl.17slon.com/book/doku.php?id=book:howto:databases). If you don't agree with that (please check the conditions at http://otl.17slon.com/book/doku.php), send me an email or reply here and I'll remove your contribution.<br /><br />[I am pretty sure that you'll be OK with it but I want to play this fair and safe.]gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-68302005142905170002012-02-03T08:58:24.336+01:002012-02-03T08:58:24.336+01:00I have included your notes in the Wiki (http://otl...I have included your notes in the Wiki (http://otl.17slon.com/book/doku.php?id=book:howto:databases). If you don't agree with that (please check the conditions at http://otl.17slon.com/book/doku.php), send me an email or reply here and I'll remove your contribution.<br /><br />[I am pretty sure that you'll be OK with it but I want to play this fair and safe.]gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-67005875404035924732012-02-03T08:06:40.878+01:002012-02-03T08:06:40.878+01:00Moz, thanks for the offer.
If you scroll to the e...Moz, thanks for the offer.<br /><br />If you scroll to the end of the chapter list at http://otl.17slon.com/book/doku.php, you'll see "OmniThreadLibrary and Databases". If you create a wiki account, I'll give you write access.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-5310779822629391032012-02-03T04:13:16.039+01:002012-02-03T04:13:16.039+01:00I think part of the reason for the paucity of docu...I think part of the reason for the paucity of documentation is that it's either very, very simple (one session or connection per thread. The end). Or it's very, very complex (ADO async, hand-rolled connection sharing, etc). If you get into NoSQL it becomes simple again, and in many ways I'd rather write sample code that does that.<br /><br />I'm happy to write up some commentary on databases once there's a spot for it and I can see the style of what you're writing. I've used OTL somewhat and databases rather a lot (and the combination whenever I've used OTL seriously). <br /><br />The simple approach is one connection per thread as noted above, and that's easy to do. But that can be wasteful of connections (which can lead to server thrashing), and if you're doing ye olde two tier development makes threading pretty much useless, since your database access is tied to the GUI which is tied to the main VCL thread.<br /><br />In that situation you can, however, cheat this quite significantly by opening datasets in threads but re-setting datasource.Active in the main thread when the dataset has finished opening (and changing the underlying session appropriately, of course). Mostly - this sort of trickery is undocumented and unsupported, but can give you huge performance wins with relatively small code changes (because you're opening slow queries in parallel). You can sometimes do this via ADO async mode but that has its own challenges.Moznoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-29174469889709287202012-02-02T16:43:14.939+01:002012-02-02T16:43:14.939+01:00"Final"(*) Wiki URL: http://otl.17slon.c..."Final"(*) Wiki URL: http://otl.17slon.com/book/doku.php<br /><br />(*) May still change if there's a good reason.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-50480939092946337832012-02-02T11:41:19.845+01:002012-02-02T11:41:19.845+01:00I'm using databases (dbExpress & MSSQL) wi...I'm using databases (dbExpress & MSSQL) with threading (not OmniThread). So far the only gotcha is that you must ensure there's a different connection object per thread.<br /><br />All I did is have a connection pool and GetConnection / FinishedWithConnection functions that ensure there's always a connection per thread ID. The connections are just reference counted to ensure they're not freed whilst in use.<br /><br />To be fair though, databases are only accessed to build a cache, so perhaps I'm not seeing some of the complexities?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-2397581145899991252012-02-02T09:50:03.360+01:002012-02-02T09:50:03.360+01:00Wiki: http://code.google.com/p/omnithreadlibrary/w...Wiki: http://code.google.com/p/omnithreadlibrary/wiki/OtlBookContents<br /><br />I'll probably move the "OTL Book Wiki" somewhere else as the Google Code Wiki is quite clumsy.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-79275174498109184072012-02-02T08:33:51.158+01:002012-02-02T08:33:51.158+01:00Pfffff, databaseses :( While I know they are impor...Pfffff, databaseses :( While I know they are important, I'm just not competent in this area. I am still looking for a brave soul that knows about databases, needs multithreading and would pursue the quest to multithreaded database application. I would provide all support on the 'multithreading' part and add any missing parts to the OTL - and at the end blog about it, of course.<br /><br />Thanks for the offer, much appreciated. I'll keep you in mind.<br /><br />Don't worry, I would never do that. I will most probably write everything in the Word and synchronize it with a Wiki when I make any significant contribution. I know this sounds like a weird plan but I need a WYSIWYG environment to write efficiently - that's something I've found out a long time ago. I simply must see beautiful font on the screen or I'm all "bleuch why I'm spending my time on this crap".gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-67010223031139282792012-02-02T07:54:32.729+01:002012-02-02T07:54:32.729+01:00I assume you will also insert your usual "and...I assume you will also insert your usual "and for those using databases, good luck" comment :)<br /><br />I'm happy to contribute if you wiki-ise it, or proofreading etc if you want to email me a copy of anything. If you do do an ebook, please don't do it by converting the PDF, just point Calibre at the wiki.Moznoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-84526201810716234842012-02-01T19:08:22.324+01:002012-02-01T19:08:22.324+01:00Well, on your podcast with Jim McKeeth you had a n...Well, on your podcast with Jim McKeeth you had a noticeable accent that made understanding you difficult at times, but I've never had any trouble with your <i>written</i> English. You're pretty good at it, and I'm sure if the users come across something confusing, we can point it out and offer suggestions on how to improve the wording.Mason Wheelerhttp://tech.turbu-rpg.comnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-14509310688955526472012-02-01T14:08:29.854+01:002012-02-01T14:08:29.854+01:00@Oliver, this is something I know nothing about. I...@Oliver, this is something I know nothing about. I would presume that it behaves exactly the same as the TThread does.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-98075074377782662012-02-01T13:59:48.060+01:002012-02-01T13:59:48.060+01:00One topic I haven't seen covered anywhere so f...One topic I haven't seen covered anywhere so far is using the OTL while dealing with COM/OLE objects. Or is that something you generally wouldn't recommend doing?Oliverhttp://ogware.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-21531420834650965782012-02-01T13:19:15.811+01:002012-02-01T13:19:15.811+01:00Thanks everybody for comments and contributions. I...Thanks everybody for comments and contributions. I agree with all of them, especially crowdsourcing some parts.<br /><br />Indeed, documentation will definitely be available in a wiki format. I also intend to publish a free pdf and maybe a payable e-book variant.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-16291992947375149982012-02-01T12:05:03.530+01:002012-02-01T12:05:03.530+01:00Most of your users won't need this, but under ...Most of your users won't need this, but under item 2 (Introduction to Multithreading), it would be great to add two subitems:<br /> a. Why multithread?<br /> b. When not to multithread<br />Under item 3, add "Why use OmniThread?"Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-45258786549100522522012-02-01T12:03:26.515+01:002012-02-01T12:03:26.515+01:00Yes, definitely consider wiki-ising it. People can...Yes, definitely consider wiki-ising it. People can add their own tips and tricks and even better code samples!<br /><br />I must say, I'm very eager to start reading it just from the outline... Documentation like this is the difference between an interesting project, and being adopted as mainstream, IMHO. It's rare to have such a well thought out point to point user guide with technical documentation.<br /><br />Fantastic work.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-25678932641801870262012-02-01T11:52:12.037+01:002012-02-01T11:52:12.037+01:00This looks great, I've been meaning to check o...This looks great, I've been meaning to check out OmniThreadLibrary for some time, but just haven't had time to sit down and experiment with it. Structured documentation like this will definitely get me trying it out and hopefully using it effectively sooner, which makes it much more appealing :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-57878264945838233762012-02-01T11:02:15.170+01:002012-02-01T11:02:15.170+01:00I'm sure you can find volunteers to clean up s...I'm sure you can find volunteers to clean up some of the English. I'd gladly offer my services on that front.David Heffernanhttps://www.blogger.com/profile/01910998949677868467noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-52016393785703436642012-02-01T10:56:54.091+01:002012-02-01T10:56:54.091+01:00+1 for crowdsourcing. You could even make the doc...+1 for crowdsourcing. You could even make the documentation a wiki, a bit like Embarcadero's.<br /><br />Also, thanks for considering documentation at all, and planning it out to this level. It's great to see a project like this with great documentation.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-77174773259389043932012-02-01T10:20:24.487+01:002012-02-01T10:20:24.487+01:00With regards to the Glossary, it may even be worth...With regards to the Glossary, it may even be worthwhile getting assistance by crowd-sourcing the Glossary. I'm sure that there is enough knowledgeable people in the community who could send in contributions to you and then you can add them or modify them to fit into the glossary. Just add the terms to the Glossary for those words that may be difficult to explain and let the Community contribute.<br />Once again, gabr thanks for making your library so accessible to us all.Colinhttps://www.blogger.com/profile/01962000164959532235noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-7494564080099046672012-02-01T09:35:49.218+01:002012-02-01T09:35:49.218+01:00Don't worry, it's not as important to do s...Don't worry, it's not as important to do some mistakes in your translations as it is in your code :-D<br />Thank you again for this great piece of work !Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-71681682535659512212012-02-01T08:00:59.079+01:002012-02-01T08:00:59.079+01:00That is a good idea but I don't know if my com...That is a good idea but I don't know if my command of the English language is good enough to write something like that.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-41909923639574313722012-02-01T04:01:09.547+01:002012-02-01T04:01:09.547+01:00A Glossary would be a great addition as well (IMO)...A Glossary would be a great addition as well (IMO). e.g. Connection pool (is that database connections, thread connections, etc). For multi-threading newbs, they can then at least understand the "language".Reganhttps://www.blogger.com/profile/15088026151789034514noreply@blogger.com