title: Parallel writes to xlsxwriter worksheet slower than sequential writes
body: <p>I wanted to write to multiple worksheets of the same workbook at the same time. 
  The code is as follows:</p>
  
  <pre><code>import threading
  import xlsxwriter
  import time
  
  
  def write_to_w1(w1, data):
      print('task1 executing....')
      for row, item in enumerate(data):
          w1.write(row, 0, item, row_format)
  
  def write_to_w2(w2, data):
      print('task2 executing....')
      for row, item in enumerate(data):
          w2.write(row, 0, item, row_format)
  
  def write_to_w3(w3, data):
      print('task3 executing....')
      for row, item in enumerate(data):
          w3.write(row, 0, item, row_format)
  
  
  start = time.time()
  data1 = [i for i in range(0,500000)]
  data2 = [i for i in range(0,500000)]
  data3 = [i for i in range(0,500000)]
  
  workbook = xlsxwriter.Workbook('~/Desktop/threading.xlsx')
  row_format = workbook.add_format({'bold': False, 'align': 'left', 'text_wrap': True, 'valign': 'vcenter'})
  w1 = workbook.add_worksheet('w1')
  w2 = workbook.add_worksheet('w2')
  w3 = workbook.add_worksheet('w3')
  
  t1 = threading.Thread(target=write_to_w1, args=(w1, data1), name='t1')
  t2 = threading.Thread(target=write_to_w2, args=(w2, data2), name='t2')
  t3 = threading.Thread(target=write_to_w3, args=(w3, data3), name='t3')
  
  # starting thread 1
  t1.start()
  # starting thread 2
  t2.start()
  # starting thread 3
  t3.start()
  
  # wait until thread 1 is completely executed
  t1.join()
  # wait until thread 2 is completely executed
  t2.join()
  # wait until thread 3 is completely executed
  t3.join()
  
  # both threads completely executed
  print("Done!")
  workbook.close()
  end = time.time()
  print('total time ==&gt;', end-start)
  </code></pre>
  
  <p>Upon benchmarking with sequential execution, <strong>the parallel version took around 52secs and sequential version took 50secs to execute</strong>.</p>
  
  <p>What is causing this performance degradation? Is synchronization the issue or is writing to a single workbook an issue?</p>