Redian新闻
>
这样的deadlock如何debug? (转载)
avatar
这样的deadlock如何debug? (转载)# DotNet - 窗口里的风景
a*f
1
【 以下文字转载自 PhotoForum 讨论区 】
发信人: alf (sometimes NNBB), 信区: PhotoForum
标 题: 摘录The Story of Art全书的前三段.
发信站: BBS 未名空间站 (Sun Nov 14 02:36:42 2010, 美东)
这是E.H. Gombrich的The Story of Art的前三段(第三段的部分). 摘下来说不定能引
起一些版友的兴趣, 去找这本经典
来看看. 我自己辛苦码了这么多字就厚着脸皮m了
There really is no such thing as Art. There are only artists. Once these
were men who took coloured earth
and roughed out the forms of a bison on the wall of a cave; today some buy
their paints, and design posters
for hoardings; they did and do many other things. There is no harm in
calling all these activities art as long
as we keep in mind that such a word may mean very different things in
different times and places. and as
long as we realize that Art with a capital A has no existence. For Art with
a capital A has come to be
something of bogey and a fetish. You may crush an artist by telling him that
what he has just done may be
quite good in its own way, only it is no 'Art'. And you may confound anyone
enjoying a picture by declaring
that what he liked in it was not the Art but something different.
Actually I do not think that there are many wrong reasons for liking a
statue or a picture. Someone may
like a landscape painting because it reminds him of home, or a portrait
because it reminds him of a friend.
There is nothing wrong with that. All of us, when we see a painting, are
bound to be reminded of a
hundred-and-one things which influence our likes and dislikes. As long as
these memories help us to enjoy
what we see, we need not worry. It is only when some irrelevant memory makes
us prejudiced, when we
instinctively turn away from a magnificent picture of an alpine scene
because we dislike climbing, that we
should search our mind for the reason for the aversion which spoils a
pleasure we might otherwise have
had. There are wrong reasons for disliking a work of art.
Most people like to see in pictures what they would also like to see in
reality. This is quite a natural
preference. We all like beauty in nature, and are grateful to the artists
who have preserved it in their works.
Nor would these artists themselves have rebuffed us for our taste. When the
great Flemish painter Rubens
made a drawing of his little boy, figure 1 he was surely proud of his good
looks. He wanted us, too, to
admire the child. But this bias for the pretty and engaging subject is apt
to become a stumbling-block if it
leads us to reject works which represent a less appealing subject. The great
German painter Albrecht Durer
certainly drew his mother, figure 2, with as much devotion and love as
Rubens felt for his chubby child. His
truthful study of careworn old age may give us a shock which makes us turn
away from it - and yet, if we
fight against our first repugnance we may be richly rewarded, for Durer's
drawing in its tremendous
sincerity is a great work. In fact, we shall soon discover that the beauty
of a picture does not really lie in the
beauty of its subject-matter.
Figure 1
Figure 2
avatar
L*e
2
【 以下文字转载自 Programming 讨论区 】
发信人: Leyunque (Le yunque), 信区: Programming
标 题: 这样的deadlock如何debug?
发信站: BBS 未名空间站 (Sun Jan 6 14:01:10 2013, 美东)
一个多线程程序,(C#),所有的Lock看起来都没有问题,运行起来会有Deadlock。程
序本身读取多个文件并存入数据库,(SQL server),有可能是C# Lock和SQL server
lock相互产生deadlock。
如何debug这样的情况呢?
avatar
r*y
3
这段话说得很经典。常常想引用,又觉得繁琐。

【在 a*f 的大作中提到】
: 【 以下文字转载自 PhotoForum 讨论区 】
: 发信人: alf (sometimes NNBB), 信区: PhotoForum
: 标 题: 摘录The Story of Art全书的前三段.
: 发信站: BBS 未名空间站 (Sun Nov 14 02:36:42 2010, 美东)
: 这是E.H. Gombrich的The Story of Art的前三段(第三段的部分). 摘下来说不定能引
: 起一些版友的兴趣, 去找这本经典
: 来看看. 我自己辛苦码了这么多字就厚着脸皮m了
: There really is no such thing as Art. There are only artists. Once these
: were men who took coloured earth
: and roughed out the forms of a bison on the wall of a cave; today some buy

avatar
c*t
4
how much data you usually save to SQL server? If too much data, which will
cause table level locking, it will prevent the coming saving request. If
data partitioned right, could help to reduce locking.

server

【在 L******e 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: Leyunque (Le yunque), 信区: Programming
: 标 题: 这样的deadlock如何debug?
: 发信站: BBS 未名空间站 (Sun Jan 6 14:01:10 2013, 美东)
: 一个多线程程序,(C#),所有的Lock看起来都没有问题,运行起来会有Deadlock。程
: 序本身读取多个文件并存入数据库,(SQL server),有可能是C# Lock和SQL server
: lock相互产生deadlock。
: 如何debug这样的情况呢?

avatar
a9
5
好好想想流程,再看下代码。如果都是相同的顺序,应该没什么问题的。

server

【在 L******e 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: Leyunque (Le yunque), 信区: Programming
: 标 题: 这样的deadlock如何debug?
: 发信站: BBS 未名空间站 (Sun Jan 6 14:01:10 2013, 美东)
: 一个多线程程序,(C#),所有的Lock看起来都没有问题,运行起来会有Deadlock。程
: 序本身读取多个文件并存入数据库,(SQL server),有可能是C# Lock和SQL server
: lock相互产生deadlock。
: 如何debug这样的情况呢?

avatar
L*e
6
thanks! can adding partition fully exclude the possibility of table level
locking?
avatar
c*t
7
if different files update different partition, yes.

【在 L******e 的大作中提到】
: thanks! can adding partition fully exclude the possibility of table level
: locking?

avatar
k*i
8
use sql profiler and some .net profiler to troubleshoot

【在 L******e 的大作中提到】
: thanks! can adding partition fully exclude the possibility of table level
: locking?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。