`
deepfuture
  • 浏览: 4333215 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:79421
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:68373
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:101495
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:281185
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:14604
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:65559
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:31318
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:45206
社区版块
存档分类
最新评论

SQLITE源码剖析(8)

阅读更多

声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iteye.com/)原创,未经笔者授权,任何人和机构不能转载

/*库线程安全

** CAPI3REF: Test To See If The Library Is Threadsafe

**SQLITE_THREADSAFE预处理宏编译时选项设为0,则忽略SQLITE的互斥代码,

**此时,sqlite3_threadsafe()返回0

** ^The sqlite3_threadsafe() function returns zero if and only if

** SQLite was compiled mutexing code omitted due to the

** [SQLITE_THREADSAFE] compile-time option being set to 0.

**SQLITE可在有互斥和没有互斥情况下编译,当SQLITE_THREADSAFE宏是1或2**时,互斥被允许,SQLITE是线程安全的。该宏为0时,不使用互斥,超过一

**个线程同时使用SQLite是不安全的

** SQLite can be compiled with or without mutexes.  When

** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes

** are enabled and SQLite is threadsafe.  When the

** [SQLITE_THREADSAFE] macro is 0, 

** the mutexes are omitted.  Without the mutexes, it is not safe

** to use SQLite concurrently from more than one thread.

**允许互斥,将会产生一些可预见的后果。如果速度是第一位的,最好是禁止

**互斥,对于最好安全性而言,互斥要开启,默认的行为是互斥开启。

** Enabling mutexes incurs a measurable performance penalty.

** So if speed is of utmost importance, it makes sense to disable

** the mutexes.  But for maximum safety, mutexes should be enabled.

** ^The default behavior is for mutexes to be enabled.

**这些接口被应用程序使用,确认该SQLITE版本编译链接时是否使用

**sqlite_threadsafe宏

** This interface can be used by an application to make sure that the

** version of SQLite that it is linking against was compiled with

** the desired setting of the [SQLITE_THREADSAFE] macro.

**该接口仅在编译时,互斥设置了SQLITE_THREADSAFE标志时才报告,如

**果 SQLITE使用SQLITE_THREADSAFE=1或=2的方式编译,互斥被允许,但

**通过SQLITE_CONFIG_SINGLETHREAD、SQLITE_CONFIG_MULTITHREAD能部分或

**完全禁止对sqlite3_config()的调用,

** This interface only reports on the compile-time mutex setting

** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with

** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but

** can be fully or partially disabled using a call to [sqlite3_config()]

** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],

** or [SQLITE_CONFIG_MUTEX].  

**sqlite3_threadsafe()函数的返回值仅指示编译时设置了线程安全

**不能被sqlite3_config()可在运行时改变

**^(The return value of the

** sqlite3_threadsafe() function shows only the compile-time setting of

** thread safety, not any run-time changes to that setting made by

** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()

** is unchanged by calls to sqlite3_config().)^

**调用sqlite3_config()不能改变sqlite3_threadsafe()返回值,

** See the [threading mode] documentation for additional information.

*/

SQLITE_API int sqlite3_threadsafe(void);

 

/*数据库连接句柄

** CAPI3REF: Database Connection Handle

** KEYWORDS: {database connection} {database connections}

**关键字:{database connection} {database connections}

**每个打开的SQLite数据库做为一个指针出现,该指针指向隐藏的sqlite3

**结构的实例,建议将sqlite3指针视 为对象 ,

**sqlite3_open()、sqlite3_open16()、sqlite3_open_v2()接口是这该对象

**的构造器,sqlite3_close()是析构器。

** Each open SQLite database is represented by a pointer to an instance of

** the opaque structure named "sqlite3".  It is useful to think of an sqlite3

** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and

** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]

** is its destructor.  

**还有一些其它接口sqlite3_prepare_v2()、sqlite3_create_function()、

**sqlite3_busy_timeout()为sqlite3 对象 的方法 

There are many other interfaces (such as

** [sqlite3_prepare_v2()], [sqlite3_create_function()], and

** [sqlite3_busy_timeout()] to name but three) that are methods on an

** sqlite3 object.

*/

typedef struct sqlite3 sqlite3;

分享到:
评论

相关推荐

    sqlite源码及分析

    文档包含sqlite源码,源码分析,以及使用教程

    SQLite源码

    SQLite源码精髓,值得学习!!SQLite源码精髓,值得学习!!SQLite源码精髓,值得学习!!

    开源数据库sqlite源码

    开源数据库源码sqlite 开源数据库sqlite源码 开源数据库sqlite源码

    Sqlite3源码分析

    sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,sqlite源码分析文档,

    sqlite源码3260000版本

    SQLite是一个小型的,支持嵌入式的数据库,C语言开发,架构清晰。适合研究SQLite源码使用。

    sqlite源码

    sqlite源码分析数据库高级教程,包括里面所有的代码

    Android SQLite源码+说明

    Android 数据库 SQLite 详细文档 以及 源代码

    sqlite源码_学习sqlite必备

    学习sqlite时需要用到的源码,是最新的版本,希望对你有用。

    sqlite源码在自己工程中的使用

    sqlite源码在自己工程中的应用,可以不依赖于其他安装程序和插件,并且纯C语言具有跨平台的特性。 工程是在Qt下的,不过代码是很简单的Demo。

    sqlite源码。。。。。。。

    这是sqlite数据库的源代码,有兴趣的可以看看是怎么实现的 方便大家学习和查阅。。。。。。。。。。。。。。

    QT操作Sqlite源码

    QT操作sqlite数据库源码,包括添加,删除,更新操作

    android sqlite源码

    这是一个安装中使用sqlite的源码,用面向对象写的,可供参考

    sqlite源码库,包含多个版本的vs

    sqlite源码库,包含多个版本的vs,可编译使用

    SQlite源码.zip

    非常好的开源C学习项目,轻量级的嵌入式...SQLite是一个开源的嵌入式关系数据库,实现自包容、零配置、支持事务的SQL数据库引擎。 其特点是高度便携、使用方便、结构紧凑、高效、可靠。足够小,大致3万行C代码,250K。

    Delphi SQLite实例源码.rar

    Delphi SQLite实例源码,现在SQLite的用途越来越广了,的确如此,SQLite强大易用,而且存储文件体积小,特别是一些单机程序,特别适合使用SQLite作为数据库,本源码就是一个在Delphi中使用SQLite的例子,一个上报...

    sqlite3.08源码包及使用指南

    sqlite3.08源码及使用指南 sqlite是嵌入式SQL数据库引擎SQLite(SQLite Embeddable SQL Database Engine)的一个扩展。 SQLite是一个实现嵌入式SQL数据库引擎小型C语言库(C library),实现了独立的,可嵌入的,零...

    C# 操作SQLite示例源码

    该示例演示C#如何连接SQLite并实现增删改查操作;演示批量操作,须要使用事务处理,才能提高效率;同时加入了SQLDapper框架,代码简练,实用,可以直接放在项目中使用;操作完成后,是完全释放了数据库资源的。该压缩...

    sqlite3源码库

    sqlite3源码,用vs2013打开项目,可以直接编译成库使用,用于访问sqlite数据库

Global site tag (gtag.js) - Google Analytics