Przejdź do treści
Logo

kuling.pl

  • Główna
  • Arkdisk
  • Forum
  • Kontakt

Jesteś tutaj

Start » Monthly archive

Kwiecień 2009

Unhandled C++ Exceptions - set_terminate

published by Kuling on śr., 2009-04-01 20:53

http://msdn.microsoft.com/en-us/library/ac9f67ah(VS.80).aspx

 

Kategorie: 
C++
Exceptions
Programowanie
  • Czytaj dalej wpis Unhandled C++ Exceptions - set_terminate
  • Blog
  • 258 odsłon

Unhandled exceptions - _set_se_translator and /EHa

published by Kuling on śr., 2009-04-01 21:29

_set_se_translator
http://msdn.microsoft.com/en-us/library/5z4bw5h5(VS.80).aspx

/EHa
http://msdn.microsoft.com/en-us/library/1deeycx5(VS.80).aspx

EXCEPTION_ACCESS_VIOLATION
http://msdn.microsoft.com/en-us/library/ms679356(VS.85).aspx

Structured Exception Handling (C++)
http://msdn.microsoft.com/en-us/library/swezty51(VS.80).aspx

 

Kategorie: 
C++
Exceptions
Programowanie
  • Czytaj dalej wpis Unhandled exceptions - _set_se_translator and /EHa
  • Blog
  • 228 odsłon

__try/__except - jak złapać EXCEPTION_ACCESS_VIOLATION

published by Kuling on śr., 2009-04-01 21:40

http://msdn.microsoft.com/en-us/library/swezty51(VS.80).aspx

int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep) 
{
   if (code == EXCEPTION_ACCESS_VIOLATION) 
   {
      return EXCEPTION_EXECUTE_HANDLER;
   }
   else 
   {
      return EXCEPTION_CONTINUE_SEARCH;
   };
}

void test()
{
	__try
	{
		*((char *)(NULL)) = 2;
	}
	__except(filter(GetExceptionCode(), GetExceptionInformation()))
	{
		cout << "wicked :)";
	}
}
Kategorie: 
C++
Exceptions
Programowanie
  • Czytaj dalej wpis __try/__except - jak złapać EXCEPTION_ACCESS_VIOLATION
  • Blog
  • 1 odpowiedź
  • 2678 odsłon

DebuggerVisualizer

published by Kuling on wt., 2009-04-07 21:30

http://pawlos.blogspot.com/2009/04/debuggervisualizer.html

Kategorie: 
Visual Studio 2003
Visual Studio 2005
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis DebuggerVisualizer
  • Blog
  • 262 odsłony

.NET Matters: False Sharing

published by Kuling on pon., 2009-04-13 13:46

Cytat:
As one example, the code in Figure 4 shows a version of this code that doesn't suffer from the same problem. Instead, it allocates a bunch of extra Random instances between those that we care about, thus ensuring that the ones we do care about are far enough apart so as to not be subject to false sharing (at least on this machine). For our tests, this updated version produced significantly better results, running up to six times faster than the code from Figure 3 on our dual-core test machine.

http://msdn.microsoft.com/en-us/magazine/cc872851.aspx

Kategorie: 
C++
Concurrency
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis .NET Matters: False Sharing
  • Blog
  • 221 odsłon

Lock Convoys

published by Kuling on pon., 2009-04-13 14:24

Cytat:
When the arrival rate at a lock is consistently high compared to its lock acquisition rate, a lock convoy may result. In the extreme, there are more threads waiting at a lock than can be serviced, leading to a catastrophe. This is more common on server-side programs where certain locks protecting data structures needed by most clients can get unusually hot.

http://msdn.microsoft.com/pl-pl/magazine/cc817398(en-us).aspx

Cytat:
Critical sections as implemented in Microsoft Windows operating systems provide a good example of how lock convoys can occur. In Windows, critical sections use a combination of a spinlock and a kernel synchronization object called an "event" to ensure mutual exclusion. For low-contention critical sections, the spinlock will provide mutual exclusion most of the time, falling back on the event only when a thread fails to acquire the spinlock within a certain amount of time. When contention is high, however, it is possible for many threads to fail to acquire the spinlock and enter a waiting state, all waiting on the same event.

http://en.wikipedia.org/wiki/Lock_convoy

Kategorie: 
Visual Studio 2003
C++
Concurrency
Visual Studio 2005
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis Lock Convoys
  • Blog
  • 263 odsłony

How to use your PC and Webcam as a motion-detecting and recording security camera

published by Kuling on czw., 2009-04-16 18:17

http://www.simplehelp.net/2006/09/27/how-to-use-your-pc-and-webcam-as-a-motion-detecting-and-recording-security-camera/

Kategorie: 
Mieszkanie
Rozrywka
  • Czytaj dalej wpis How to use your PC and Webcam as a motion-detecting and recording security camera
  • Blog
  • 267 odsłon

Use Thread Pools Correctly: Keep Tasks Short and Nonblocking

published by Kuling on wt., 2009-04-21 18:25

http://www.ddj.com/go-parallel/article/showArticle.jhtml?articleID=216500409

Kategorie: 
Visual Studio 2003
C++
Concurrency
Visual Studio 2005
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis Use Thread Pools Correctly: Keep Tasks Short and Nonblocking
  • Blog
  • 274 odsłony

Bambrick's 8th Rule of Code Reuse

published by Kuling on śr., 2009-04-22 19:00

Cytat:
It's far easier and much less trouble to find and use a bug-ridden, poorly implemented snippet of code written by a 13 year old blogger on the other side of the world, than it is to find and use the equivalent piece of code, written by your team leader on the other side of a cubicle partition.

http://www.secretgeek.net/open_code_sharing.asp

Kategorie: 
Visual Studio 2003
C++
Visual Studio 2005
Programowanie
Visual Studio 2008
Templates
  • Czytaj dalej wpis Bambrick's 8th Rule of Code Reuse
  • Blog
  • 285 odsłon

Perspektywy amerykańskiego dolara

published by Kuling on śr., 2009-04-22 19:13

http://wojciechbialek.blox.pl/2009/04/Perspektywy-amerykanskiego-dolara-1.html

Kategorie: 
Pieniądze
  • Czytaj dalej wpis Perspektywy amerykańskiego dolara
  • Blog
  • 220 odsłon

Baltic Dry Index

published by Kuling on śr., 2009-04-22 21:48

http://zezorro.blogspot.com/2009/04/do-contanga-trzeba-dwojga.html

http://en.wikipedia.org/wiki/Baltic_Dry_Index

Cytat:
On the world’s largest VLCC trading route, from the Middle East to Japan, rates have fallen to under $8,000 per day, just over 10% of the $70,000 per day seen at the beginning of 2009.   “There’s no reason why the market should be where it is,” said Frontline acting chief executive Jens Martin Jensen.   “It doesn’t make any sense. If [a crude oil trader] pays $50 a barrel and you have 2m barrels on board [a tanker] worth $100m, who cares if you are paying $10,000 or $20,000 per day? It doesn’t make any difference. It’s weakness in certain owners minds.

http://ftalphaville.ft.com/blog/2009/04/20/54845/tanked/?source=rss

http://www.naftemporiki.gr/markets/quotegraph.asp?id=.BADI&ctime=5Y&cperiodicity=D&cstyle=L

Kategorie: 
Inwestowanie
Pieniądze
  • Czytaj dalej wpis Baltic Dry Index
  • Blog
  • 1 odpowiedź
  • 253 odsłony

Co oznacza powrót Amerykanów do oszczędzania?

published by Kuling on śr., 2009-04-22 22:02

http://www.trystero.pl/archives/2992

 

Kategorie: 
Inwestowanie
Mieszkanie
Pieniądze
  • Czytaj dalej wpis Co oznacza powrót Amerykanów do oszczędzania?
  • Blog
  • 225 odsłon

Create a Language Compiler for the .NET Framework

published by Kuling on śr., 2009-04-22 22:39

http://msdn.microsoft.com/en-us/magazine/cc136756.aspx

Kategorie: 
C++
Visual Studio 2005
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis Create a Language Compiler for the .NET Framework
  • Blog
  • 221 odsłon

Exception safe code in real world

published by Kuling on sob., 2009-04-25 11:49

Below you can find three methods of writing exception safe code in real world. In the order prefered by author:

- Petru's ScopeGuard
- RAII
- try / catch mess
http://www.ddj.com/cpp/184403758

Kategorie: 
Visual Studio 2003
C++
Visual Studio 2005
Exceptions
Programowanie
Visual Studio 2008
Templates
  • Czytaj dalej wpis Exception safe code in real world
  • Blog
  • 269 odsłon

C++ FAQ Lite - Exceptions and error handling

published by Kuling on sob., 2009-04-25 12:26

http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.11

Kategorie: 
Visual Studio 2003
C++
Visual Studio 2005
Exceptions
Programowanie
Visual Studio 2008
  • Czytaj dalej wpis C++ FAQ Lite - Exceptions and error handling
  • Blog
  • 296 odsłon

typename keyword versus class keyword

published by Kuling on sob., 2009-04-25 12:29

Can you explain the purpose of the typename keyword in C++? When should I use it instead of <class T>? Is there some difference between the two?

http://msdn.microsoft.com/en-us/magazine/cc188951.aspx

Kategorie: 
Visual Studio 2003
C++
Visual Studio 2005
Programowanie
Visual Studio 2008
Templates
  • Czytaj dalej wpis typename keyword versus class keyword
  • Blog
  • 270 odsłon

IMF Global Financial Stability Report - April 2009

published by Kuling on ndz., 2009-04-26 12:18

Strasznie dużo czytania. Samo przejrzenie obrazków zajeło mi ponad godzinę. :)

http://www.imf.org/external/pubs/ft/gfsr/2009/01/pdf/text.pdf

http://www.rybinski.eu/?p=720&language=pl

Kategorie: 
Inwestowanie
Pieniądze
  • Czytaj dalej wpis IMF Global Financial Stability Report - April 2009
  • Blog
  • 239 odsłon

try/catch in constructor

published by Kuling on ndz., 2009-04-26 20:48

Morals About Safe Coding

Cytat:
Moral #4: Always perform unmanaged resource acquisition in the constructor body, never in initializer lists. In other words, either use "resource acquisition is initialization" (thereby avoiding unmanaged resources entirely) or else perform the resource acquisition in the constructor body.

Cytat:
Moral #5: Always clean up unmanaged resource acquisition in local try block handlers within the constructor or destructor body, never in constructor or destructor function try block handlers.

Cytat:
Moral #8: Prefer using "resource acquisition is initialization" to manage resources. Really, really, really. It will save you more headaches than you can probably imagine, including hard-to-see ones, similar to some we've already dissected.

More Exceptional C++, Herb Sutter

 

Kategorie: 
C++
Exceptions
Programowanie
  • Czytaj dalej wpis try/catch in constructor
  • Blog
  • 259 odsłon

Aktualnie czytam - More Exceptional C++ Herb Sutter

published by Kuling on pon., 2009-04-27 19:29

Kategorie: 
C++
Exceptions
Programowanie
Templates
Informatyka
  • Czytaj dalej wpis Aktualnie czytam - More Exceptional C++ Herb Sutter
  • Blog
  • 267 odsłon

MSVC, STL, locale and thread-unfriendly object

published by Kuling on wt., 2009-04-28 17:55

http://www.lenholgate.com/archives/000824.html

Kategorie: 
Visual Studio 2003
C++
Concurrency
Visual Studio 2005
Programowanie
Visual Studio 2008
Templates
  • Czytaj dalej wpis MSVC, STL, locale and thread-unfriendly object
  • Blog
  • 292 odsłony

Kolejność synchronizowania według kolejności adresów w pamięci?

published by Kuling on wt., 2009-04-28 18:28

Jak wiadomo dead-locki (najczęstsze) powstają w następujacych sytacjach:

  • mamy dwa (conajmniej) obiekty synchronizujace S1, S2
  • wątek T1 zawłaszcza obiekty w kolejności S1, S2
  • wątek T2 zawłaszcza obiekty w kolejności S2, S1
  • oba wątki wykonują się w tym samym czasie

Jakiś czas temu wklejałem link do artykułu gdzie zalecano hierachię (globalną hierarchię) wszystkich sekcji krytycznych tak aby unikać dead-locków. http://www.ddj.com/hpc-high-performance-computing/204801163?pgno=3

Dziś znalazłem całkiem ciekawy sposób ustalania globalnej hierachii.

Można brać sekcje w kolejności rosnących fizycznych adresów w pamięci. :) Fajne, czyż nie?

http://www.lenholgate.com/archives/000449.html
http://blogs.codehaus.org/people/jboner/archives/001135_use_total_ordering_of_objects_to_avoid_deadlocks.html

 --

I jeszcze trochę na temach hierarchii:
http://www.onjava.com/pub/a/onjava/2004/10/20/threads2.html?page=1

Cytat:
The most practical rule to avoid deadlock is to make sure that the locks are always acquired in the same order. In our example, it means that either the score or character lock must be acquired first—it doesn't matter which as long as we are consistent. This implies the need for a lock hierarchy—meaning that locks are not only protecting their individual items but are also keeping an order to the items. The score lock protects not only the values of the score, but the character lock as well.

--

I jeszcze troche na temat poziomów:
http://msdn.microsoft.com/en-us/magazine/cc163618.aspx

Cytat:
While lock leveling works, it does not come without challenges. Dynamic composition of software components can lead to unexpected runtime failures. If a low-level component holds a lock and makes a virtual method call against a user-supplied object, and that user object then attempts to acquire a lock at a higher level, a lock hierarchy-violation exception will be generated. A deadlock won't occur, but a run-time failure will. This is one reason that making virtual method calls while holding a lock is generally considered a bad practice. Although this is still better than running the risk of a deadlock, this is a primary reason databases do not employ this technique: they must enable entirely dynamic composition of user transactions.

--

I jeszcze trochę:
http://www.justsoftwaresolutions.co.uk/threading/acquiring-multiple-locks-without-deadlock.html

Cytat:
The easiest way to deal with this is to always lock the mutexes in the same order. This is especially easy if the order can be hard-coded, and some uses naturally lend themselves towards this choice. For example, if the mutexes protect objects with different roles, it is relatively easy to always lock the mutex protecting one set of data before locking the other one. In such a situation, Lock hierarchies can be used to enforce the ordering — with a lock hierarchy, a thread cannot acquire a lock on a mutex with a higher hierarchy level than any mutexes currently locked by that thread.
Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Kolejność synchronizowania według kolejności adresów w pamięci?
  • Blog
  • 208 odsłon

Test się skończy, stres – zostanie?

published by Kuling on śr., 2009-04-29 23:09

http://blogi.bossa.pl/?p=955

Kategorie: 
Giełda
Pieniądze
  • Czytaj dalej wpis Test się skończy, stres – zostanie?
  • Blog
  • 293 odsłony

Archiwum

  • luty 2012 (1)
  • Styczeń 2012 (7)
  • Grudzień 2011 (2)
  • Listopad 2011 (2)
  • Październik 2011 (2)
  • Wrzesień 2011 (3)
  • Sierpień 2011 (2)
  • Lipiec 2011 (3)
  • Czerwiec 2011 (1)
  • Kwiecień 2011 (4)
  • luty 2011 (1)
  • Styczeń 2011 (2)
  • Listopad 2010 (6)
  • Październik 2010 (5)
  • Sierpień 2010 (10)
  • Lipiec 2010 (3)
  • Czerwiec 2010 (2)
  • Maj 2010 (1)
  • Kwiecień 2010 (2)
  • luty 2010 (4)
  • Styczeń 2010 (5)
  • Grudzień 2009 (5)
  • Listopad 2009 (1)
  • Październik 2009 (4)
  • Wrzesień 2009 (6)
  • Sierpień 2009 (11)
  • Lipiec 2009 (23)
  • Czerwiec 2009 (14)
  • Maj 2009 (23)
  • Kwiecień 2009 (22)
  • Marzec 2009 (14)
  • luty 2009 (20)
  • Styczeń 2009 (14)
  • Grudzień 2008 (17)
  • Listopad 2008 (12)
  • Październik 2008 (10)
  • Wrzesień 2008 (4)
  • Lipiec 2008 (2)
  • Czerwiec 2008 (5)
  • Maj 2008 (5)
  • Kwiecień 2008 (9)
  • Marzec 2008 (9)
  • luty 2008 (30)
  • Styczeń 2008 (22)
  • Grudzień 2007 (15)
  • Listopad 2007 (19)
  • Październik 2007 (10)
  • Wrzesień 2007 (22)
  • Sierpień 2007 (21)
  • Lipiec 2007 (29)
  • Czerwiec 2007 (53)
  • Maj 2007 (61)
  • Kwiecień 2007 (14)
  • Marzec 2007 (5)
  • luty 2007 (4)
  • Styczeń 2007 (16)
  • Grudzień 2006 (69)
  • Listopad 2006 (15)
  • Wrzesień 2006 (25)
  • Sierpień 2006 (20)
  • Lipiec 2006 (10)
  • Czerwiec 2006 (10)
  • Maj 2006 (35)
  • Kwiecień 2006 (5)
  • Marzec 2006 (15)
  • luty 2006 (5)
  • Grudzień 2005 (10)
  • Listopad 2005 (15)
  • Sierpień 2005 (10)
  • Lipiec 2005 (20)
  • Czerwiec 2005 (30)
  • Maj 2005 (30)
  • Kwiecień 2005 (34)
  • Marzec 2005 (14)
  • luty 2005 (10)
  • Grudzień 2004 (30)
  • Listopad 2004 (48)
  • Październik 2004 (25)
  • Sierpień 2004 (18)
  • Lipiec 2004 (30)

Kategorie

  • Angielski (1)
    • FCE (0)
  • Dom (4)
    • Akwarium (3)
    • Kot (2)
  • Gry (11)
    • Counter Strike (8)
  • Informatyka (15)
    • Hardware (15)
      • Mój komputer (14)
    • Linux (0)
    • Programowanie (173)
      • C++ (134)
        • Concurrency (66)
        • Exceptions (14)
        • Templates (21)
      • Narzędzia (10)
        • Visual Studio 2003 (21)
        • Visual Studio 2005 (45)
        • Visual Studio 2008 (33)
        • Visual Studio 2010 (13)
      • PHP (9)
    • Windows (18)
  • Internet (10)
    • Drupal (18)
    • Linki (29)
  • Miejsca (2)
    • Poznań (3)
    • Sieradz (1)
    • Wrocław (12)
    • Zgorzelec (0)
  • Pieniądze (122)
    • Giełda (47)
    • Inwestowanie (66)
    • Mieszkanie (69)
  • Rodzina (14)
    • Magda (1)
  • Rozrywka (66)

Logowanie

  • Utwórz nowe konto
  • Prześlij nowe hasło
Theme provided by Danetsoft under GPL license from Danang Probo Sayekti