2

Can I use my working Python code as Jython? Are there any differencies? The point is that I have code in Python, but I want to divide the code into, at least, 2 parallel running processes to improve speed of my program. This can be done using Python because of Global Interpreter Lock. So my idea is to get whole code and compile it using Jython compiler.

Is it possible? If yes, are there any disadvantages?

Milano
  • 18,048
  • 37
  • 153
  • 353
  • possible duplicate of [Are CPython, IronPython, Jython scripts compatible with each other?](http://stackoverflow.com/questions/1953989/are-cpython-ironpython-jython-scripts-compatible-with-each-other) – ivan_pozdeev Nov 09 '14 at 19:16
  • 1
    you need to be a bit more descriptive of the kind of code you are planning to port. In an ideal scenario will work just by using jython code.py. But the reality is you will find that that is not the case. First of all what is it that you are doing that needs you to run 2 parallel processes? Is the task IO bound or CPU bound? Did you try using multiprocessing module ? – neotrinity Nov 12 '14 at 14:24

1 Answers1

2

Most of my code works fine on both Python and Jython. I often use databases (Oracle, PostgreSQL and Informix), so I have different "connector" for Jython (which uses JDBC) and for Python (various libraries). There are some little bugs in Jython 2.5.3 I use like parsing date with %f, but most of libraries I use just work with Jython.

You question is very general. I don't think we can help you without more details like libraries you use (databases, scientific, games, network, text processing etc).

Michał Niklas
  • 53,067
  • 18
  • 70
  • 114