Psycopg2 Connection Pool Multiprocessing

A module for asynchronous PostgreSQL queries in Tornado. pgpool feat and devel - Free download as PDF File (. txt) or read book online for free. Simple Postgresql Database Connections with Python. connect? Or pass connect_args to create_engine?. SimpleConnectionPool. It is written in Python and gives full power and flexibility of SQL to an application develope. Wenn ich pool = Pool(proccesses=1), läuft es in einem einzigen Thread ganz gut. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. This method is a coroutine. New minconn connections are created automatically. #Craeting database connection pool to help connection shared along process. The connection class¶ class connection¶ Handles the connection to a PostgreSQL database instance. This new pool, like all SQLAlchemy connection pools, does not make any actual connections to the database until one is first requested, so as long as the Engine isn't used again, no new connections will be made. Write a custom getconn method and passing async=True to psycopg2. In short I want the ability to tell a connection that it is a read-write, read-only or write-only connection. For best performance, it is recommended that you use a connector library that supports connection pooling. If Patroni cannot access the Primary because the connection pool is full, behavior will be undesirable. Odoo ist einzigartig, weil es sehr einfach zu bedienen ist und gleichzeitig vollständig integriert. SQLAlchemy - Quick Guide - SQLAlchemy is a popular SQL toolkit and Object Relational Mapper. 0 and it is thread safe (threads can share the connections). A pool opens a number of connections and handles thread safety when providing connections to requesters. Random connection close exception - when you close your connection twice. PostgreSQL database adapter for the Python programming language - psycopg/psycopg2. The lowest level of abstraction in postgres is a psycopg2 connection pool that we configure and manage for you. ThreadedConnectionPool. Connection instance. from psycopg2. Although this has given a speed increase, it still seems like there are. Java Project Tutorial - Make Login and Register Form Step by Step Using NetBeans And MySQL Database - Duration: 3:43:32. LIFO; Using Connection Pools with Multiprocessing; API Documentation - Available Pool Implementations; Core Events. Connections are created using the factory function connect(). Search Search. redis属于单进程的服务,它主要受内存、CPU、磁盘IO(主要是做持久化),如果服务器配置比较高,多核CPU、高内存的服务器. In my web app some postgres sql queries take along time for execution. Everything in postgres, both the simple API and the context managers, uses this connection pool. This is a list of all source packages that have at least one lintian tag. Re: psql on Mac. class psycopg2. roundtrip to the database. It useful to be able to spawn a thread and pass it arguments to tell it what work to do. How to share connection pool with multiprocessing Python. For example, a connection pool might support a fixed number of simultaneous connections, or a network application might support a fixed number of concurrent downloads. Add a DB connection pool using gevent to django (based on django-db-geventpool) - 1. Using connection pooling will allow your app to reuse existing database connections instead of having to open and close a new one every time, and broken connections can be resumed automatically. connection_poo. > > each client request? I use psygopg2. oracle 12c RAC. Zenko (“Good fox” in Japanese) is a reporting system (see code on Github here) I’ve created over the last couple of weeks at Mozilla. 1 for CPython 2 and 3 (or psycopg2-binary—see notes in the psycopg2 2. especially "pickling a socket" is not supported; you have to scale back to pyprocessing (hosted on berlios, converted to multiprocessing for 2. By default, the driver is determined automatically. 当创建的任务不多时,可以利用multiprocessing中的Process动态生产多个进程, 但如果有上百或上千目标,手动的去创建进程的工作量巨大,此时就可以用到multi 博文 来自: Mogul的博客. This is particularly problematic with pgbouncer, which will essentially stop acting like a connection pool if you disconnect from the server mid-transaction. However, instead of Nginx, I am using Cherokee. Introduction¶. The following statement creates a new database named suppliers in the PostgreSQL database server. The module wraps the excellent 'psycopg2' library and most of the functionality is provided by this behind the scenes, except for pooling. Because the number of workers is defined, there’s no risk of spinning up too many as the dataset grows. Chapter 3 Selecting a Topology After estimating the factors related to performance as explained in Chapter 2, "Planning your Environment," you should decide the topology that you will use to deploy Sun Java™ System Application Server 7 Enterprise Edition. You should use the new way in most cases. Connection pooling. For example, a connection pool might support a fixed number of simultaneous connections, or a network application might support a fixed number of concurrent downloads. Connection Pooling¶. Learn about building, deploying and managing your apps on Heroku. ) and make sure your application's connection pool takes less time than these values. Developed middle layer controllers in C on Solaris for backend mission-critical transaction processing on BroadVision one to one platform. Particularly for server-side web applications, a connection pool is the standard way to maintain a "pool" of active database connections in memory which are reused across requests. These steps will ensure that regardless of whether you're using a simple SQLite database, or a pool of multiple Postgres connections, peewee will handle the connections correctly. I use Python’s multiprocessing module to spawn multiple HTTPServer instances with my application. So if anyone still see this issue: when using psycopg2 instead of pyPgSQL when using Trac 0. pool for lightweight connection pooling. 3Introducing Pool The real power of Momoko comes with Pool(). The following are code examples for showing how to use multiprocessing. YAML Configuration 5. Pool is initialized with N processes, the workers are assigned databases 1 through N. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. OperationalError) could not translate host name "musicbrainz_db" to address: Name or service not known. A connection pool can be named at pool creation time. redis属于单进程的服务,它主要受内存、CPU、磁盘IO(主要是做持久化),如果服务器配置比较高,多核CPU、高内存的服务器. py仔细阅读一番,就会发现其实逻辑很简单。 class ThreadedConnectionPool(AbstractConnectionPool): """A connection pool that works with the threading module. Psycopg2 is a DB API 2. OperationalError: server closed the connection unexpectedly,抱着“春节前也不是那么忙,闲着也有点儿*疼”的想法,对该报错的产生原因进行分析。. 前面一篇已经把multiprocessing. Connection pooling is implemented by thinly wrapping a psycopg2 connection object with a pool-aware class. Furthermore, don't try to share a connection across processes: it won't work (see the docs for relevant info). ” “When java program startup, one thread begins running immediately. 2 for sure). Would a connection Pool benefit a multithreaded Java program. TCP connections are represented as file descriptors, which usually work across process boundaries, meaning this will. The size of each connection pool is capped at maxPoolSize, which defaults. The platform architecture scales “up” through symmetric multiprocessing (SMP) and faster CPUs, and it scales “out” linearly with the number of servers. My current setup is using python and psycopg2 such as below. Though it is fundamentally different from the threading library, the syntax is quite similar. 0 parlance), so concurrent calls to psycopg2. You can contribute to the development of H2 by sending feedback and bug reports, or translate the H2 Console application (for details, start the H2 Console and select Options / Translate). The lowest level of abstraction in postgres is a psycopg2 connection poolthat we configure and manage for you. dummy import Pool as ThreadPool from multiprocessing import Pool from multiprocessing. Choose a driver, and configure your development environment accordingly: Python SQL driver. connection_pool: cls. You can vote up the examples you like or vote down the ones you don't like. In my web app some postgres sql queries take along time for execution. Its goal is to provide common ground for all Elasticsearch-related code in Python; because of this it tries to be opinion-free and very extendable. I'm trying to speed up my PostGIS queries using multiprocessing. Within a process one or more threads can make use of the pool of socket connections to the database utilizing up to maxpoolsize connections in accordance with the parameters waitQueueMultiple and waitQueueTimeoutMS parameters. connection pooling. Alternatively you can use a connection. ps_connection = psycopg2. dummy import Pool as ThreadPool. The docs for multiprocessing are a lot more straightforward than the asyncio ones. Note This pool class can be safely used in multi-threaded applications. This includes all tags, even experimental and info tags and tags that were overridden. pdf), Text File (. org/sqlalchemy/sqlalchemy/rev/d8e6d00fb96f changeset: 7280:d8e6d00fb96f user: zzzeek date: Tue Jan 18 17:13:36 2011 -0500 description. A connection pool is a standard technique used to maintain long running connections in memory for efficient re-use, as well as to provide management for the total number of connections an application might use simultaneously. After I while my connections seem to fill up and then my script is been stuck. The function will receive a long list of strings, split the list into equal parts, and process each part on a separate CPU using Python's multiprocessing module. notices and ~connection. 官方文档 点这里 这里对普通的connection和使用pool的connection进行了10000次查询测试普通的代码: 使用了连接池的代码 快了近12倍 psycopg2. A connection pool is a group of physical connections to a database that can be shared by several named connections. The following classes are AbstractConnectionPool subclasses ready to be used. The size of each connection pool is capped at maxPoolSize, which defaults to 100. They can also be used directly for applications that want to add. In this section I will describe how to add hooks to your web app to ensure the database connection is handled properly. The modules in CELERY_IMPORTS and CELERY_INCLUDE are now imported in the original order (Issue #1161). Python psycopg2. " Hi all: Could anyone please give me some kind of advice, suggestion on how I can fix this problem ""dataSQLException: SQLException: Cannot get a connection, pool exhausted"" I am attaching the log file and connection pool parameters values below. psycopg2 connection. This entire process looks very simple to develop, though it may not be that simple to implement as developing a solution from scratch need planning, coding, triage, testing and eventually time and money. The simplest way to use a Thread is to instantiate it with a target function and call start() to let it begin working. Chapter 3 Selecting a Topology After estimating the factors related to performance as explained in Chapter 2, "Planning your Environment," you should decide the topology that you will use to deploy Sun Java™ System Application Server 7 Enterprise Edition. The pool will support a maximum of about maxconn connections. My end goal is to learn how to insert data from Python to a database with multiprocessing. dsnattribute. See “Configuring Logging” in the SQLAlchemy manual. connection = DBConnection(instance, id, password, user_name) return connection It looks like there is a missing SQL connector pool module but I have no idea what it is. the SQLAlchemy connection pool (which is what this is using) calls connection. Here's how to work directly with a psycogpg2 cursor while still taking advantage of connection pooling: >>>. They are extracted from open source Python projects. Zenko (“Good fox” in Japanese) is a reporting system (see code on Github here) I’ve created over the last couple of weeks at Mozilla. Sometimes it is necessary to configure some component’s setup and tear down. Format sql in db. This is the the bit that matters most. This is especially necessary for + authentication handler authors + - certifi support was removed + - Fixed bug where using OAuth 1 with body ``signature_type`` sent no data + - Major proxy work thanks to @Lukasa including parsing of proxy authentication + from the proxy url + - Fix DigestAuth handling too many 401s + - Update vendored urllib3. details: http://hg. The following are code examples for showing how to use psycopg2. Connection / Engine API; Connection Pooling. false (Optional) Use the advanced (eventlet safe) memcached client pool. You can vote up the examples you like or vote down the ones you don't like. Before you can access PostgreSQL databases using Python, you must install one (or more) of the following packages in a virtual environment: psycopg2: This package contains the psycopg2 module. 7 for PyPy; Patch psycopg2. Que por sua vez remete para a libpq: The connection parameters can be specified either as a libpq connection string using the dsn parameter or using a set of keyword arguments. initializing multiple connections from multiprocessing threads causes database connections to fail to be created create the connection pool when you initialize. After entering the correct SQLAlchemy URI click test button to test your connection. By default, the driver is determined automatically. I do not use the original connections in the child process. live connection among widgets and application variables python-avogadro Multiprocessing Pool Extensions for Python python-binaryornot (0. Odoo ist einzigartig, weil es sehr einfach zu bedienen ist und gleichzeitig vollständig integriert. A connection pool is a standard technique used to maintain long running connections in memory for efficient re-use, as well as to provide management for the total number of connections an application might use simultaneously. This includes all tags, even experimental and info tags and tags that were overridden. Conclusion. from multiprocessing import Pool and explicitely added a commit to the connection further down (conn. Introduction¶. connection pooling. A pool opens a number of connections and handles thread safety when providing connections to requesters. an asterisk is put after packages in dbs format, which may then contain localized files. Psycopg2 Connection Pool. Overview of pg/python 4. py is simple in-process code that hands around connections, which can be handy for multi-threading, and for a little less management. See momoko. which is incredibly detailed and looks as though I have misunderstood what multiprocessing. class psycopg2. This reduces latency from database authentication and connection startup time. The transaction implicitly starts as soon as the Session starts communicating with the database and will remain open until the Session is committed, rolled back or closed. This has been a ton of notes on more direct usage of psycopg2. Automatic retry db. The connection class tells the database server pool that connections are related. the connection and cursor returned by cursor() are proxied for garbage collection/connection pool purposes but call upon the psycopg2 API for their behavior and methods. So the question was, how to close SQLALchemy's connection? Answer came in this stackoverflow thread, engine. Ich gebe auch verschiedene printinganweisungen ein, um sicherzustellen, dass die meisten tatsächlich ausgeführt werden. 5-1) ABI Generic Analysis and Instrumentation Library (documentation). They are extracted from open source Python projects. My understanding is that with multiprocessing the script will read data from a file and start entering data into the database at parallel. multiprocessing. A curated list of awesome Python adapter for Python. Port details: python36 Interpreted object-oriented programming language 3. I have updated the psycopg2 version to 2. 1 for CPython 2 and 3 (or psycopg2-binary—see notes in the psycopg2 2. Entity Framework 6 Correct a foreign key relationship; Entity Framework 6 Correct a foreign key relationship. map_async) 线程与进程的理解 进程:是执行中一段程序,即一旦程序被载入到内存中并准备执行,它就是一个进程。进程是表示资源分配的的基本概念,又是调度运行的基本单位,是系统中的并发执行的单位. listPrimaryKey(db, table) [source] ¶ List the fields of the primary key of the given table in the database. (Environment is: python 3. 3 and PyPy with Psycopg2, psycopg2ct and psycopg2cffi. For single-threaded programs there is one connection in the pool. Note that this connection pool generates by itself the required keys using the current thread id. When specifying a URI, if you omit the username and database name to connect with, Queries will use the current OS username for both. 1 Increase the Number of Connection Pool If EPM data. connection_pool: cls. If you would like features like a connection pool object (as other databases have) or multiprocessing helpers, please leave us a note in our GitHub issues! ←. Serializing the calls to psycopg2. I'm trying to use the multiprocess Pool object. Psycopg2 is a DB API 2. A module for asynchronous PostgreSQL queries in Tornado. dummy import Pool as ThreadPool from multiprocessing import Pool from multiprocessing. If close is True, discard the connection from the pool. from multiprocessing import Pool and explicitely added a commit to the connection further down (conn. Connection Pool Configuration; Switching Pool Implementations; Using a Custom Connection Function; Constructing a Pool; Pool Events; Dealing with Disconnects; Using FIFO vs. Connection pooling. you also want to make sure you revert any isolation level settings on the connection back to normal before returning it to the pool. INFO) # "set to logging. We will also install the psycopg2 package that will allow us to use the database we configured: pip install django psycopg2 We can now start a Django project within our myproject directory. description` items (🎫 `#661`). Queries built-in connection pooling will re-use connections when possible, lowering the overhead of connecting and reconnecting. The simple connection pool is not appropriate for concurrent programs: you should use probably the ThreadedConnectionPool, after checking that the lock it uses is correctly made green by gevent. This is a fascinating and exciting talk about a patch/extension to make CPython use IOCP on Windows for completion-based asynchronous IO. Its important to note that when using the SQLAlchemy ORM, these objects are not generally accessed; instead, the Session object is used as the interface to the database. Wie man sieht, kennt SQLAlchemy sowohl die explizite (mit connection) und implizite (ohne connection) Ausführung von Befehlen. The task is use own RAW database connection instead of SQLAlchemy plugin together with Flask + uWSGI. Is this correct? But then I found this q&a Accessing a MySQL connection pool from Python multiprocessing. This includes all tags, even experimental and info tags and tags that were overridden. routine library such as gevent in a pylons based WSGI app. 7的,win32ras模块需要下载pywin32。. PostgreSQL database adapter for the Python programming language - psycopg/psycopg2. A module for asynchronous PostgreSQL queries in Tornado. For each database connection established from a client, the database server such as MySQL allocates a set of buffers to cater to the client needs. - Added `connection. The decorator gives each function a connection pool, uses jsonschema to validate input and output, responds to CORS OPTIONS from anywhere, and uses print statements for logging. Software Packages in "buster", Subsection doc 4ti2-doc (1. The lowest level of abstraction in postgres is a psycopg2 connection pool that we configure and manage for you. How to best use connection pooling in SQLAlchemy for PgBouncer transaction-level pooling? Ask Question conn = psycopg2. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. Developed middle layer controllers in C on Solaris for backend mission-critical transaction processing on BroadVision one to one platform. 3Introducing Pool The real power of Momoko comes with Pool(). The output includes the word "Worker" printed five times, although it may not be entirely clean depending on the order of execution. A load balancing method and system for a transaction computer system having multiple database servers for at least one database, wherein database servers cooperate to provide a unified view of the data in the database. Note that all the connections are closed, including ones eventually in use by the application. Put away a connection. This sped things up for me: import math from multiprocessing. I have tried to use a key, but it didn't work so I would appreciate it if someone could point me in the right direction. Odoo ist ein Paket von Open-Source-Unternehmensapps, das all Ihre Unterenehmensbedürfnisse abdeckt: CRM, E-Commerce, Buchhaltung, Lagerwirtschaft, Kassensystem, Projektmanagement, etc. Queue though). Django in its 'out-of-the-box' state is set up to communicate with SQLite -- a lightweight relational database included with the Python distribution. pool) Cursor context handler; Context Manager for explicit transactions; Python API to wrap basic SQL. The docs for multiprocessing are a lot more straightforward than the asyncio ones. put(conn, block=False) return # Everything is dandy, done. Python thread pool similar to the multiprocessing Pool? 2015-07-13 python Python. It is supplied as a live DVD image that comes with several lightweight window managers, including Fluxbox, Openbox, Awesome and spectrwm. Scribd is the world's largest social reading and publishing site. python How to set statement timeout for query execution. The wrapper will forward almost everything to the wrapped cursor, so the usual DB-API interface can be used, but it will return Deferred objects that will fire with the DB-API results. There are others ([2][2]), but this one attempts to provide connection persistance / pooling with as few dependencies as possible. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. My current setup is using python and psycopg2 such as below. It is designed for multi-threaded applications and manages its own connection pool. (integer value) #memcache_pool_unused_timeout = 60 # (Optional) Number of seconds that an operation will wait to get a memcached # client connection from the pool. NOTE: Please use BaseDriver. Users of neutron, meanwhile, should use the ‘default_floating_pool’ option in the ‘[neutron]’ group. Creating new PostgreSQL connections can be an expensive operation. - async_psycopg2. A module for asynchronous PostgreSQL queries in Tornado. Außerdem ist zu sehen, dass SQLAlchemy standardmäßig im „Auto-Commit“ Modus arbeitet, bei dem Befehle. apply_async poo. The thread will stop again right away after it is started. pool - Connections pooling¶. table_oid` and `~psycopg2. However, in chaotic environments like Openstack, we also have a per-connection checker: def _add_process_guards(engine): """Add multiprocessing guards. O 게시물 “Accessing a MySQL connection pool from Python multiprocessing“에서 언급했듯이 : Making a seperate pool for each process is redundant and opens up way too many connections. PO files — Packages not i18n-ed [ L10n ] [ Language list ] [ Ranking ] [ POT files ] Those packages are either not i18n-ed or stored in an unparseable format, e. This is a regression that was introduced in 0. In Zotonic a process fetches a database connection from a pool of connections for every single query or transaction. the connection and cursor returned by cursor() are proxied for garbage collection/connection pool purposes but call upon the psycopg2 API for their behavior and methods. For both of these reasons, none of those events provide us with a connection object. This module offers a few pure Python classes implementing simple connection pooling directly in the client application. Set up a database for a Django project. Package Index: M-R. When using psycopg2 with the default READ COMMITTED isolation level, the database driver will implicitly open a transaction for each new connection. itertools (2. It's production-ready, unlike your prototype. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. With the trend toward more, rather than faster, cores, exploiting concurrency is increasing in importance. Most of the times, this library is used as an Object Relational Mapper (ORM) tool that translates Python classes to tables on relational databases and automatically converts function calls to SQL statements. Other interesting features of the adapter are that if you are using the PostgreSQL array data type, Psycopg will automatically convert a result using that data type to a Python list. pool import ThreadedConnectionPool. 5-1) ABI Generic Analysis and Instrumentation Library (documentation). This document describes the Python Database API Specification 2. Although this has given a speed increase, it still seems like there are. Communication Between Processes¶ As with threads, a common use pattern for multiple processes is to divide a job up among several workers to run in parallel. My current setup is using python and psycopg2 such as below. """WatIAM download check process. Tutorials and Exercises to cover Python Basics to Data analytics and Database. Connection instance. This is always an important performance consideration, but it can be particularly important in a busy system using Serializable transactions. py and aiohttpdemo_polls/main. How does connection pooling work in PyMongo? Kate Spade Black Leather Bow Crossbody NWT; Does PyMongo support Python 3? Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted? Why does PyMongo add an _id field to all of my documents? Key order in subdocuments – why does my query work in the shell but not PyMongo?. multiprocessing is a package that supports spawning processes using an API similar to the threading module. I'll set up a pool with a number of connections and the pool between processes. prop is correct as well as conn. How do you close the connection before forking? I am doing something like this. The multiprocessing package also includes some APIs that are not in the threading module at all. SQLAlchemy Connection Pool. Insertion will block once this size has been reached, until queue items are consumed. memcache_use_advanced_pool¶ Type. [jira] [Updated] (AIRFLOW-4134) "DB connection invalidated" warning at every zombie check: Date: Wed, 20 Mar 2019 21:35:00 GMT. This looks good to me, although the purpose of the move of the 4 lines (l. Overview of psycopg2 (multi-threading, connection pool, etc. Popular Python Packages matching "pooling" HTTP library with thread-safe connection pooling, file post, and more. 1-3) Tools for working with iterables (Python 2) python-jaxml (3. (' connection pool. It is designed for multi-threaded applications and manages its own connection pool. I have a connection pool serving web sessions, and I want to. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Prepared statements have all the usual benefits in Go: security, efficiency, convenience. Each process will then look into that pool and if a connection is available use it or else wait until a connection is freed. Developed middle layer controllers in C on Solaris for backend mission-critical transaction processing on BroadVision one to one platform. , can see http requests. Bases: txpostgres. The connection class¶ class connection¶ Handles the connection to a PostgreSQL database instance. It's not possible to pickle a connection nor a cursor because the connection wraps an open socket, which has a state that can't be pickled. putconn (connection) ¶ Return busy connection back to the pool. Work comes into the server and needs to get processed. Every thread has a priority. Note that all the connections are closed, including ones eventually in use by the application. First close(), the connection returns to the pool. getconn retrieves a connection from the pool (if one is available, blocking until one is ready), then when we’re done we can pool. conf that made it unable to talk to my postgresql. If you do not use a pool in global scope, and/or if you create individual connections in function-scope, then you should close these connections before the function returns. multiprocessing is a package that supports spawning processes using an API similar to the threading module. Note that this connection pool generates by itself the required keys using the current thread id. pool is None. You should use await conn. Virtualization refers to creating a virtual version of something. One other interesting feature of the driver is that if you use the PostgreSQL array data type, Psycopg2 will automatically convert a result containing that data type to a Python lis. 7 for PyPy; Patch psycopg2. This project is released under the same license as psycopg2, the LGPLv3. A connection pool is a group of physical connections to a database that can be shared by several named connections. Basically. Before you can access PostgreSQL databases using Python, you must install one (or more) of the following packages in a virtual environment: psycopg2: This package contains the psycopg2 module. The purpose of this document is to demonstrate the integration of pyATS around multiprocessing process forks. Connections are created using the factory function connect(). TCP connections are represented as file descriptors, which usually work across process boundaries, meaning this will. This is run after every download of the WatIAM Extract. Write a custom getconn method and passing async=True to psycopg2. test plugin to store test expectations and mark tests based on them (mingw-w64) mingw-w64-python-pytest-forked: 1. Connect using Devarts PgSqlConnection, PgOleDb, OleDbConnection, psqlODBC, NpgsqlConnection and ODBC. map_async) 线程与进程的理解 进程:是执行中一段程序,即一旦程序被载入到内存中并准备执行,它就是一个进程。进程是表示资源分配的的基本概念,又是调度运行的基本单位,是系统中的并发执行的单位. __name__() 。 模块列表.