New Release: Threaded Blog Comments



ComicList: New Comic Book Releases List for Wednesday, December 16, 2020, a list of the comic books, graphic novels, and other products that should be available at your local or online comic book shop this week. New Releases Thread 12/28 - 1/3 Please post all your questions, pics and comments about upcoming new releases here. Remember all screenshots of carts and order confirmations will be deleted if they're posted outside this thread.

  1. New Release: Threaded Blog Comments Examples
  2. New Release: Threaded Blog Comments Example

New Release: Threaded Blog Comments Examples

Let us face the fact : there is no multi-threading possibilities for VBA. However, if you have any VBA program in your Excel workbook, create multiple copies of that workbook and finally start that VBA program within each of the copied workbook, you got multiple Excel workbooks (VBA programs) running simultaneously. By definition, that is multi-threading.
One may ask with very good reason why even bother, since we already have easy-to-use multi-threading libraries available for more sophisticated languages ? Sometimes you may not have any other choice. A few years ago I started to work with one 'state-of-the-art' analytics library for processing some extremely time-consuming calculations. By that time, all calculations were supposed to be processed in Excel and we did not have any access to real development API. Very fortunately, I discovered a collection of relevant VBA interface functions available for that library. Despite of this amazing discovery, processing calculations in VBA was still annoyingly slow. Finally I decided to test the scheme described above. I created multiple copies of one master workbook (which was having a relevant program for processing required calculations), opened multiple Excel workbooks and finally started a program within each workbook (almost) simultaneously. This was truly a 'poor man's multi-threading', but despite of that it really did the job well. Example program in this post is taking this described scheme a bit further, as it completely removes the burden of administrating required Excel workbooks.New Release: Threaded Blog Comments
NewThe main idea for this program is to create desired amount of active workbook copies (which has a relevant program for processing required calculations) into a folder. Moreover, for each of the workbook copy, corresponding VB script file will be created for starting required VBA program within Excel workbook copy. VB script is also taking care of all relevant administrative responsibilities (cleaning all Excel workbooks and VB script files from folder after program execution). Calculation results from different Excel threads will be printed into a shared text file. It should be noted, that SomeComplexAlgorithm procedure is an entry point for Excel thread (started by VB script). For brevity reasons, the content of this example program has been left to be trivial (simulate random number between one and ten for delay time execution and finally store that number into a collection).
Insert a new VBA module and copy-paste the following program.Tool
New release: threaded blog comments toolSimulating 100 random numbers (setting delay time to 1) using just one Excel thread : processing time 0:01:50.

Simulating 100 random numbers (setting delay time to 1) using four Excel threads (25 numbers for each thread) : processing time 0:00:30, which turns out to be almost quadruple time improvement in comparison with single-threaded processing.

New Release: Threaded Blog Comments Example






Finally, thanks for reading this blog.
-Mike