From: Alex Ciarlillo Date: 2007-03-29T01:37:14+09:00 Subject: Re: Help with Excel (win32ole) and threads!? Jano Svitok wrote: > To parallelize this you'd probably use more processes, either using > Win32::Process from win32utils or manually spawning some worker > processes and communicating with the main process using drb or > similar. I did a test in the way you suggested and the WIN32OLE is blocking I'm pretty sure. I don't think its blocking continuously until the thread is finished, but when I output 1000 rows of data to excel in one thread and print the numbers 1-50 to the screen in another, there is a noticeable pause between each number being printed (as opposed to them printing almost instantly w/o win32ole). I figure this means that the OLE is blocking on each output call as you suggested. I did figured out how to spawn the new process with win32-process and found out about Marshaling. I figured I could just create a process so that it takes a Worksheet object (marshaled from a file) and does all the output to that sheet. The only problem is WIN32OLE objects have no marshal_dump method defined, so I have no way to pass the sheets around to different processes. I did not try DRb but I figured it would have the same problem in this case. I could write my own marshal_dump but I doubt that writing such a method for a win32ole object is within my scope of knowledge. I have pretty much eliminated SQLite as the reason for the threads not running in parallel since I read up more about read/write locks and how they are used in sqlite3. All my database connections are reading and should be able to do so concurrently with no problems. So anymore ideas on how to parallelize excel output over multiple worksheets? Thanks for all the help! -Alex -- Posted via http://www.ruby-forum.com/.