Database Example Problem

Hello, I have a hobby project. I have two text file, I’m trying to read them parallel so I can save them database. It is writing only one file so I couldn’t understand why?
Please help me.

Have you tried to run the function synchronously with the thread?
and use $ global.

How can I run the function synchronously with the thread? Can you give me a example please?

Ex:

a = proc{|i| puts i}
b = proc{|a| puts a}

t1 = Thread.new{a.call}
t2 = Thread.new{b.call}

t1.join
t2.join

thread