Results 1 to 8 of 8
  1. #1
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Crazy threads problem with Java on WINE

    I'm stuck running a Windows app on WINE. The app embeds a JVM. I've installed the Oracle JVM. It works. So far so good.

    The problem comes when one of my embedded Java routines tries to start a helper thread that runs some DB routines in the background while the main thread does some other processing. Sometimes it works perfectly. And when it works, it runs 50% faster than doing everything in one thread. But sometimes, the second thread just never starts. (I know this because I added a trace statement to the beginning of its run method.)

    I've tried setting the main thread to MIN_PRIORITY and the helper thread to MAX_PRIORITY, to no avail.

    Is there any other way I can coax the JVM to start the damn thead?
    Get in the habit of using standard Java naming conventions!

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Isn't WINE a MS Windows emulator for Unix/Linux boxes? Why don't you run a native JVM on those machines? Oracle has one for Linux boxes.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    The Windows app running in WINE can't embed the Linux JRE, so I had to install the Windows JRE inside WINE.

    Apparently there are other issues with concurrency in the app. I gave up on the threaded version of my code.
    Get in the habit of using standard Java naming conventions!

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by kjkrum View Post
    The Windows app running in WINE can't embed the Linux JRE, so I had to install the Windows JRE inside WINE.
    No, I mean: why use WINE while you can run Java on the native OS (Linux/Unix)?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    Because I'm running a Windows app. It embeds a JVM and uses Java as its scripting language, but it's mostly a native Win32 app.
    Get in the habit of using standard Java naming conventions!

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by kjkrum View Post
    Because I'm running a Windows app. It embeds a JVM and uses Java as its scripting language, but it's mostly a native Win32 app.
    And you can't run this all as a native MS Windows application either? If not, my feeling is that it's WINE goofing with the Thread handling, not the JVM.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default

    For better or worse, no. The only Microsoft product I own is a mouse.
    Get in the habit of using standard Java naming conventions!

  8. #8
    stchman's Avatar
    stchman is offline Member
    Join Date
    Apr 2011
    Location
    Saint Louis, Missouri
    Posts
    97
    Rep Power
    0

    Default

    I've been using Ubuntu now for years and I have come to the following conclusion.

    Windows apps are best run on Windows.

    I generally have found a Linux app that does what the Windows app used to do for me. I also dual boot when I have a Windows app that I have to use on occasion.

    Another option you have is to use VirtualBox. There you can run Windows while running Linux.
    If you aren't programming in Java, well that's just too bad.
    I'd rather be using Ubuntu.

Similar Threads

  1. Problem running many Threads !!
    By AlQassabi in forum Threads and Synchronization
    Replies: 10
    Last Post: 03-04-2011, 10:29 AM
  2. Driving me crazy!!!! Please help!!
    By Quizzle23 in forum New To Java
    Replies: 33
    Last Post: 02-24-2011, 08:00 AM
  3. Lead Web Developer Oppty at the "Pandora for Wine"
    By WineTamer in forum Jobs Offered
    Replies: 0
    Last Post: 01-28-2010, 11:08 PM
  4. A crazy gui match
    By amarenash23 in forum New To Java
    Replies: 8
    Last Post: 12-30-2009, 03:39 PM
  5. problem with threads
    By amith in forum Threads and Synchronization
    Replies: 4
    Last Post: 07-10-2008, 07:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •