202 words

Multithreading Test and Deadlock

#1
2011-05-04 00:27

I move on to testing the multi threaded part of ObjectDB. From the same code (MyMain.java), I set the thread count from 1 to 4 and not only do I found it's slower overall (each thread only needs to insert 250K entities) but the threads are stuck with a deadlock.

All threads share the same EntityManagerFactory but they have their own EntityManager.

The stack trace and the test are attached.

edy_at_ssn
edy_at_ssn's picture
Joined on 2011-05-03
User Post #8
#2
2011-05-04 04:08

Thank you for the deadlock report. Please try build 2.2.3_05 that should fix it.

Regarding multithreading speed - currently in ObjectDB embedded mode multithreading improves performance in reading but not in writing. You can see this in the JPAB benchmark (compare 1 thread to 5 threads). ObjectDB is faster than the alternatives also when using multithreading in writing but the gap becomes smaller, so there may be a place for improvement here.

Your test shows that multithreading is even slower, but I found that using smaller transactions (2,000 instead of 10,000 entity objects per transaction) brings 1-thread and 4-threads runs to equivalent results, so maybe in this test 4 threads are slower because of higher memory usage (4 x 10,000 x 100 strings x attribute length => many MBs).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #244
#3
2011-05-04 21:42

Thanks. It solved the dead lock.

edy_at_ssn
edy_at_ssn's picture
Joined on 2011-05-03
User Post #9

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel