Skip to main content

Build Wine rpm with 32 bit application support

Wine is a software to allow running Windows applications in Linux, MAC etc. platforms. It is available for installation from package managers like yum (RHEL, CentOS) and apt (Ubuntu). You can find more details on how it works in Wine wiki.

But the default Wine package available from package manager does not have support for 32 bit Windows applications. This was the case for me. In Redhat Enterprise Linux 7.3, the wine package did not contain support for 32 bit windows applications. So the only option was to build a separate rpm of wine which will include this support.

All the steps are executed on a RHEL 7.3 VM (x86_64).

Step 1
Download and run shell script which will make wine 64 and 32 support for RHEL: It accepts a version no. as CLI parameter e.g. 2.0.3

The script installs wine in /usr/local/ directory by default. We can verify the files that are being copied for wine using "cd /usr/src/wine-2.0.…

Using Multi threading with Drools

Drools is a very popular rule engine. It is based on Rete algorithm. To understand what is a rule engine and how to use it check here. But here I will assume that you have some working knowledge on Drools.

What I am going to discuss in this post is 'how to use multi-threading with Drools'. Below is a snippet which creates a KnowledgeBase from a DRL file.

If this method is called from multiple threads I get below exception -

Exception in thread "Thread-60" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... globals != empt ....}]
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(**)
at org.mvel2.MVELInterpretedRuntime.parse(**)
at org.mvel2.MVEL.eval(**)
at org.mvel2.templates.res.IfNode.eval(**)
at org.mvel2.templates.res.TextNode.eval(**)
at org.mvel2.templates.res.TerminalNode.eval(**)
at org.mvel2.templates.res.ForEachNode.eval(**)
at org.mvel2.templates.res.TextNode.eval(**)
at org.mvel2.templates.res.TerminalNode.eval(**)
at org.mvel2.templates.res.IfNode.eval(**)
at org.mvel2.templates.res.TextNode.eval(**)
at org.mvel2.templates.res.ExpressionNode.eval(**)
at org.mvel2.templates.res.TextNode.eval(**)
at org.mvel2.templates.TemplateRuntime.execute(**)
at org.mvel2.templates.TemplateRuntime.execute(**)
at org.mvel2.templates.TemplateRuntime.execute(**)
at org.mvel2.templates.TemplateRuntime.execute(**)
at **)
at **)
at org.drools.compiler.PackageBuilder.addRule(**)
at org.drools.compiler.PackageBuilder.addPackage(**)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(**)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(**)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(**)
at com.myfirm.RuleFlowProcess.init(**)
at com.myfirm.RuleFlowProcess.clone(**)
at com.myfirm.ThreadTest$**)
Caused by: *java.lang.NullPointerException*
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(**)
... 27 more

The exception normally occurs at KnowledgeBuilder.add(...) method. This can happen infrequently depending on the thread behavior. But there is always a chance to find this error in your production environment.
Now the question is, how do we resolve this? One way, is to share the same knowledge base for all threads. But due to synchronized APIs you will not achieve the performance. Threads will run sequentially. There is another simple solution -

I have used synchronization on current Class object (don't confuse with the new instance of class). There is a single lock available for a Class. So, we can make threads sequential by synchronizing on the class level lock. This will not hit the performance much. Once the KnowledgeBase is created you can run parallel threads for rule execution. No further synchronization required.


  1. it workd ..thanks dude..u r champ

  2. Can u post complere implementation of two drools file executing simultaneously using multithreading

    1. Sorry, it was quite sometime back. I do not have the files with me now. I will ring up my colleagues and see if they have a backup.

  3. This comment has been removed by a blog administrator.

  4. I am not sure where you're getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for magnificent information I was looking for this info for my mission.
    Arm Pain Frankfort
    Abdominal Pain Frankfort
    Back Pain Frankfort
    Cancer Pain Management Frankfort
    Chest Wall Pain Frankfort
    Disc Herniation Frankfort

  5. Hello admin! This is remarkable article as well as it is valuable for the entire person and I want to say that I would like to write on this subject too. You have an interesting written of this topic.
    Headache Pain Frankfort
    Hip Pain Frankfort
    Neck Pain Frankfort
    Pelvic Pain Frankfort
    Phantom Pain Frankfort
    Sciatica Pain Frankfort


Post a Comment