Daniel Berger
2006-May-30 03:25 UTC
[Win32utils-devel] seg on windows-pr-0.5.1 (was RE: [ANN] win32-eventlog 0.4.0)
Pe?a wrote:> Hi Dan, > i get a segfault on windows-pr if i run mulitple tails by threading, one thread for each host i''m tailing. > > C:\family\ruby\win-eventlog>dtail.rb > thread/tail-ing Security on host1 > thread/tail-ing Security on host2 > thread/tail-ing Security on host3 > thread/tail-ing Security on host4 > thread/tail-ing Security on host5 > thread/tail-ing Security on host6 > c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.5.1-mswin32/lib/windows/error.rb:295: [BUG] Segmentation fault > ruby 1.8.4 (2005-12-24) [i386-mswin32] > C:\family\ruby\win-eventlog> > > my code looks like, > > #--- > threads = [] > while x = DATA.gets do > eventlog,host = x.split > printf "thread/tail-ing %s on %s\n",eventlog,host > threads << Thread.new(eventlog,host) do |log,host| > tail_log log,host > end > #tail_log eventlog, host > end > threads.each {|t| t.join} > #--- > > is tail thread-safe or do i need to run it separately for each host for the mean time?Wow, I never imagined folks running a series of eventlogs in different threads. Anyone have any ideas on this? Dan
Heesob Park
2006-May-30 03:59 UTC
[Win32utils-devel] seg on windows-pr-0.5.1 (was RE: [ANN] win32-eventlog 0.4.0)
Hi, 2006/5/30, Daniel Berger <djberg96 at gmail.com>:> Pe?a wrote: > > Hi Dan, > > i get a segfault on windows-pr if i run mulitple tails by threading, one thread for each host i''m tailing. > > > > C:\family\ruby\win-eventlog>dtail.rb > > thread/tail-ing Security on host1 > > thread/tail-ing Security on host2 > > thread/tail-ing Security on host3 > > thread/tail-ing Security on host4 > > thread/tail-ing Security on host5 > > thread/tail-ing Security on host6 > > c:/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.5.1-mswin32/lib/windows/error.rb:295: [BUG] Segmentation fault > > ruby 1.8.4 (2005-12-24) [i386-mswin32] > > C:\family\ruby\win-eventlog> > > > > my code looks like, > > > > #--- > > threads = [] > > while x = DATA.gets do > > eventlog,host = x.split > > printf "thread/tail-ing %s on %s\n",eventlog,host > > threads << Thread.new(eventlog,host) do |log,host| > > tail_log log,host > > end > > #tail_log eventlog, host > > end > > threads.each {|t| t.join} > > #--- > > > > is tail thread-safe or do i need to run it separately for each host for the mean time? > > Wow, I never imagined folks running a series of eventlogs in different > threads. > > Anyone have any ideas on this? > > Dan >I guess the code needs something like this for thread-safe: require ''thread'' semaphore = Mutex.new semaphore.synchronize { get_last_error } Regards, Park Heesob
Seemingly Similar Threads
- Syslogging and remote installer (was RE: seg on windows-pr-0.5.1 (was RE: win32-eventlog 0.4.0))
- Automatically detecting LUNs without a reboot
- PMTU = 1518 over local network at 1500 MTU
- Scripting help please....
- [ win32utils-Bugs-28904 ] Gem win32-eventlog v0.5.2 on Ruby 1.9.1 and 1.9.2