ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Understanding Network I/O, Part 2
Subject:   Mixing C and Python.
Date:   2004-02-13 11:20:25
From:   jbi130
Before I discovered Python I wrote an event driven server in C (using libevent). At first it was mainly I/O bound so it worked out great. Then came along some CPU intensive tasks, so I spin off a few threads. They are pretty localized so my only locks are for passing events in and out of the threads.


Now I'm looking at doing more work with Python. Whats the ideal mix of Python and C. I'm looking at using Python modules to extend my C app.


Obviously the other way is to use Python and extend in C. If my C exensions are working in threads how will this affect Python and the GIL?


I'd probably keep all I/O event based and in the main thread and just use worker threads to do the long running tasks.


So now I have to decide, C as the main loop or Python/Twisted.


1 to 2 of 2
  1. Mixing C and Python.
    2004-02-23 00:15:24  belotsky [View]

  2. Mixing C and Python.
    2004-02-14 01:00:29  spiv [View]

1 to 2 of 2