- 浏览: 100473 次
- 性别:
- 来自: HK
文章分类
最新评论
-
Mr.小裤裤:
谢谢,
我生日过的很快乐,
o(∩_∩)o...
system badimageformatexception and its partial solution
quote:
It's not so much that they're not performed, it's that because you called a reactor API from a thread, which you are never ever ever allowed to do , you have put your program into a state where everything is completely broken, forever . Every future API call may produce bizarre, broken results, or no results, or random, inexplicable crashes.
You know, the normal way multithreaded programs work ;-).
To repeat: every API in twisted, with the sole exception of callFromThread
(and by extension things which call callFromThread
, like blockingCallFromThread
), is not thread safe
.
Unfortunately, putting in warnings for every single API would be both a
code maintenance nightmare, so several users have discovered this
constraint in the same way that you have, by calling an API and noticing
something weird.
If you have some code which runs in a thread that needs to call a reactor API, use callFromThread
or blockingCallFromThread
and it will dispatch the call to the reactor thread, where everything
should work smoothly. However, for stuff like timed calls, there's
really no need to use threads at all, and they would needlessly
complicate your program.
by Glyph
link: http://stackoverflow.com/questions/3220991/difference-between-loopingcall-and-callinthread-in-pythons-twisted
发表评论
-
static building lxml
2014-08-13 19:15 828well it is not really straig ... -
build pyrun/python from source
2014-08-01 19:39 592quite easy on ubuntu. 1: ... -
build apsw manually
2014-01-06 01:22 551download sqlite sources and co ... -
python, vs 2010 & manifest problem
2013-11-02 13:33 635It looks like python com ... -
numpy 1.7.0 fails with cx_freeze 4.3.1
2013-02-24 16:13 858It is a work around: find ... -
build psycopg2 on windows with mingw64
2013-01-03 20:36 976caution: version match problem. ... -
Determining if a point lies on the interior of a polygon
2012-09-25 02:23 687link: http://paulbourke.net/geo ... -
pypy的一个测试
2012-06-09 16:15 1612pypy-1.9 昨天已经发布,据称性能又有所提高。 ... -
a naive way to use dictcursor of psycopg2 with twisted adbapi
2012-05-03 03:14 1174make a new file called fakedb.p ... -
build psycopg2 on windows with vs
2012-05-02 02:16 871prerequisites: 1: postgresq ... -
twisted iocp reactor is still buggy---it was fixed on 23/10/2012
2012-03-19 14:53 1265I reported a bug on last wee ... -
One way to speed up Pb invoke.
2012-03-14 21:31 851Pb (stands for Perspecti ... -
change buffer size in order to send chunks data in ampoule
2011-12-03 16:08 810ampoule use name pipe to commun ... -
cython的另类用途
2011-08-04 02:30 1587都知道py虽然方便但是却有个不是问题的问题:就是发布时的二进制 ... -
instructions for installing some python's pkgs on ubuntu
2011-07-23 00:54 788make sure python-dev, gcc and o ... -
a tedious way to build the latest pytables
2011-07-17 03:33 723pyTables is a great product. It ... -
再谈twisted
2011-06-29 17:03 1443现在我手头用的是11.0。 很好。没什么很大的问题,原来的版本 ... -
cython的效果
2011-06-29 00:29 813我有个用py写的 crc-ccitt的验证程序(实现效率并不高 ... -
the simplest way to use vs 2010 with python
2011-06-03 15:48 680edit py/Lib/distutils/msvc9comp ... -
speeding up python
2011-06-03 15:36 891python确实是十分慢的语 ...
相关推荐
- **Thread Safety**: `Vector` is synchronized and thread-safe, making it suitable for multi-threaded environments, whereas `ArrayList` is not synchronized and requires external synchronization for ...
One way in which we keep the code base manageable is by enforcing consistency. It is very important that any programmer be able to look at another's code and quickly understand it. Maintaining a ...
SortedDictionary : is the internal .net implementation which is said to be a Red/Black tree. Really big data sets! To really put the engine under pressure I did the following tests on huge data sets...
LINQ unique is that it enables programmers to create type-safe data access code complete with Intellisense support and compile time syntax checking. Paul Kimmel has done an excellent job of presenting...
although the extension is built against the most current PHP version at that time. The VCx marker tells with which compiler the extension was built, and Non-thread-safe whether ZTS was disabled....
- **How a Servlet Works**: When a request is sent to a servlet, the servlet container creates a new instance of the servlet if one does not already exist. The `init()` method initializes the servlet, ...
- By defining ZLIB121, VCLZip will use the latest version of ZLib which is included with the registered version. Some optimization improvements which should show some improvement in zipping and ...
In contrast it is using TypeSafe records (without boxing/unboxing) and type safe emitted code. The code is emitted only once per table. It has therefore I believe the potential to be the fastest ...
TMonitor, thread-safe queues, and TEvent. It is also one of the most complex chapters. By the end of this chapter, the reader will be able to create and communicate with background threads, leaving ...
- **Agents:** Agents are used to manage state in a thread-safe manner. They are particularly useful when working with Java code in Akka. #### Networking Networking is a critical aspect of Akka, ...
retrieved and SendMessage is a boolean function (maybe someone has pressed the cancel btn).- Fixed a bug when the subject field is too large.9/2/981.5.1- Fixed a bug with a message within a message ...
It has some interesting concepts and features such as immutability, gradual typing, thread-safe concurrency primitives, and macro-based metaprogramming, which makes it a great choice to create modern...
If you follow the logic of the program it does teach a lot about multithreading and the necessary techniques to do this in a 'Thread Safe environmen<END><br>37,callback.zip This small project is ...
04. If after all still the activator fails then try running it in Safe Mode (F8) using an Administrator account. 05. In case SysMech cannot be installed because of the message "You cannot install ...
EGOCache is a simple, thread-safe key value cache store. It has native support for NSString, UI/NSImage, and NSData, but can store anything that implements <NSCoding>. All cached items expire after ...
Fixed bugs with StrToInt which should be StrToInt64. ! Fixed bug with tag parsing where tags like "bla>bla" caused the parser to stop on the ">". Version 2.23 (02Dec2005) ! Fixed bug in entity ...
27)..Fixed: Ignored unhandled thread exceptions (when EurekaLog is disabled) now triggers default OS processing (WER) 28)..Fixed: Irnored exceptions (via per-exception/events) now bring up default RTL...
circular_buffer_demo.zip A circular, thread-safe read/write character buffer (12KB)<END><br>67,avltree_demo.zip Describes an implementation of AVL Trees. (54KB)<END><br>68,metaclass_demo.zip ...
39.zip Dialog which can be used as MDI child window 使用MDI子窗口的对话框(13KB)<END><br>40,40.zip Convert modal dialogs to modeless 将模式对话框转换成非模式对话框(12KB)<END><br>41,41.zip...