Przejdź do treści
Logo

kuling.pl

  • Główna
  • Arkdisk
  • Forum
  • Kontakt

Jesteś tutaj

Start » Monthly archive

Lipiec 2009

C++ 0x - Jednolita składnia dla funkcji

published by Kuling on śr., 2009-07-01 21:35

http://pl.wikipedia.org/wiki/C%2B%2B0x#Jednolita_sk.C5.82adnia_dla_funkcji

Kategorie: 
C++
Programowanie
Templates
Visual Studio 2010
  • Czytaj dalej wpis C++ 0x - Jednolita składnia dla funkcji
  • Blog
  • 282 odsłony

Nature breaks anything that is too big

published by Kuling on czw., 2009-07-02 21:47

http://zezorro.blogspot.com/2009/07/nassim-taleb-na-cnbc.html

Kategorie: 
Pieniądze
  • Czytaj dalej wpis Nature breaks anything that is too big
  • Blog
  • 238 odsłon

Próby leczenia rynku derywatyw USA

published by Kuling on wt., 2009-07-07 18:15

Ciekawy wpis na blogu Piotra Kuczyńskiego. Polecam.

http://kuczynski.blogbank.pl/2009/07/07/leczenie-objawowe-czy-proba-radykalnej-kuracji/

Kategorie: 
Inwestowanie
Pieniądze
  • Czytaj dalej wpis Próby leczenia rynku derywatyw USA
  • Blog
  • 194 odsłony

Single Reader, Single Writer Fixed Sized Lookaside Dequeu

published by Kuling on wt., 2009-07-07 19:22

http://www.insomniacgames.com/tech/articles/0807/files/multithreading_optimization_basics.pdf

Rules for use:

  • Push() can only be called from one thread, but it doesn't need to be the same thread as Pop().
  • Pop() can only be called from one thread, but it doesn't need to be the same thread as Push().
  • max_count must be a power of two
  • Don't Pop() more than Count()
  • Check IsFull() or Count() before a Push()
Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Single Reader, Single Writer Fixed Sized Lookaside Dequeu
  • Blog
  • 216 odsłon

InterlockedMultiply

published by Kuling on wt., 2009-07-07 19:57

http://blogs.msdn.com/oldnewthing/archive/2004/09/15/229915.aspx

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis InterlockedMultiply
  • Blog
  • 194 odsłony

ABA problem

published by Kuling on wt., 2009-07-07 20:33

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

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis ABA problem
  • Blog
  • 281 odsłon

System.Collections.Concurrent Namespace - .NET 4.0

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

Bardzo ciekawe klasy. Zwłaszcza iteratory. Iterator dający możliwość iteracji w sposób wątkoodporny brzmi ciekawie.
http://msdn.microsoft.com/en-us/library/system.collections.concurrent%28VS.100%29.aspx

I blog jednego z ludzi zajmujących się jak podejrzewam implementacją tych iteratorów.
http://blogs.msdn.com/pfxteam/archive/2008/08/12/8852005.aspx

Enumerating Concurrent Collections
http://www.infoq.com/news/2008/08/Parallel-Enumerators
Zwłaszcza to wylistowanie jest fajne:

  • Deleted items will always be seen
  • Deleted items will never be seen
  • Added items will always be seen if added at the end of the collection
  • Added items will always be seen if added wherever they are added
  • Added items will always never be seen
  • Moved items will never be seen twice
  • Moved items will be seen twice, if moved to the end of the collection
  • Moved items will always be seen, even if moved to the beginning of the collection
  • No more than N items will be seen, where N is the original length of the collection

     

 

Kategorie: 
C++
Concurrency
Programowanie
Templates
Visual Studio 2010
  • Czytaj dalej wpis System.Collections.Concurrent Namespace - .NET 4.0
  • Blog
  • 248 odsłon

Almost user mode - unfair mutex - Optex

published by Kuling on pon., 2009-07-13 08:57

Build a Richer Thread Synchronization Lock
http://msdn.microsoft.com/pl-pl/magazine/cc163642.aspx

Reader/Writer Locks and the ResourceLock Library
http://msdn.microsoft.com/en-us/magazine/cc163599.aspx

 

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Almost user mode - unfair mutex - Optex
  • Blog
  • 241 odsłon

A simple condition variable primitive

published by Kuling on śr., 2009-07-15 19:53

http://www.bluebytesoftware.com/blog/2009/07/14/ASimpleConditionVariablePrimitive.aspx

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis A simple condition variable primitive
  • Blog
  • 246 odsłon

What Every Dev Must Know About Multithreaded Apps

published by Kuling on śr., 2009-07-15 20:42

Naprawdę wyjątkowo dobrze napisany artykuł. Jeśli nawet nie masz czasu przeczytać go dziś to koniecznie zbookmarkuj na jakiś deszczowy dzień.

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

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis What Every Dev Must Know About Multithreaded Apps
  • Blog
  • 184 odsłony

Low-Lock Techniques - Vance Morrison

published by Kuling on śr., 2009-07-15 22:15

Cytat:
The biggest conceptual difference between sequential and multithreaded programs is the way the programmer should view memory. In a sequential program, memory can be thought of as being stable unless the program is actively modifying it. For a multithreaded program, however, it is better to think of all memory as spinning (being changed by other threads) unless the programmer does something explicit to freeze (or stabilize) it.

Cytat:

Sequential consistency is an intuitive model and, as the previous example shows, some of the concepts of sequential programs can be applied to it. It is also the model that gets implemented naturally on single-processor machines so, frankly, it is the only memory model most programmers have practical experience with. Unfortunately, for a true multiprocessor machine, this model is too restrictive to be implemented efficiently by memory hardware, and no commercial multiprocessor machines conform to it.

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

 Jestem w połowie czytania, strasznie długo to trwa, ale naprawdę warto.

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Low-Lock Techniques - Vance Morrison
  • Blog
  • 213 odsłon

Która mafia ustala nam ceny kredytów?

published by Kuling on śr., 2009-07-15 22:31

http://samcik.blox.pl/2009/07/Jaka-mafia-ustala-ceny-kredytow.html

Kategorie: 
Mieszkanie
Pieniądze
  • Czytaj dalej wpis Która mafia ustala nam ceny kredytów?
  • Blog
  • 246 odsłon

Don't let a long-running operation take hostages

published by Kuling on czw., 2009-07-16 21:12

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

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Don't let a long-running operation take hostages
  • Blog
  • 209 odsłon

Reader Writer Lock

published by Kuling on pon., 2009-07-20 19:50

Poluję na reader writer lock spełniający następujące wymagania:

  1. C++/Win32/32bit
  2. Readers reentrancy.
    Jeśli dany wątek ma reader-lock w metodzie i woła inną metodę w tym samym wątku to ta metoda może wząść reader-lock ponownie (innymi słowy czytelnik może wziąść sekcję czytania wielokrotnie).
  3. Writer reentrancy.
    Jeśli dany wątek ma writer-lock w metodzie i woła inną metodę w tym samym wątku to ta metoda może wząść writer-lock ponownie (innymi słowy czytelnik może wziąść sekcję czytania wielokrotnie).
  4. Hierachy WR.
    Jeśli dany wątek ma writer-lock to może wziąść reader-lock.
  5. Hierachy RW.
    Jeśli dany wątek ma reader-lock to może wziąść writer-lock (chyba marzenie, nie wiem czy to do osiągnięcia bez dead-lock'ów).
  6. Weakening of writer-lock.
    Jesli wątek ma writer-lock to może go osłabić i zamienić na reader-lock (nie wymagane, mile widziane).
  7. Preferences.
    Nie daje preferencji ani pisarzom ani czytelnikom (jeśli już trzeba to niech preferuje pisarzy).
  8. TryEnter
    Metody w stylu try-enter mile widziane zarówno dla czytelnika jak i dla pisarza.
  9. Timeouts
    Timeouty do czekania mile widziane zarówno dla czytelnika jak i dla pisarza.
  10. Fairness
    "fairness", sprawiedliwość nie jest wymagana choć jeśli by była to bym nie płakał
  11. Starvation
    Zagłodzenie. Nie mile widziane choć akceptowalne.
     

Troszkę literatury:

http://en.wikipedia.org/wiki/Readers-writers_problem
http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx
http://blogs.msdn.com/vancem/archive/2006/03/29/564854.aspx
http://www.cs.rochester.edu/research/synchronization/pseudocode/rw.html
http://msdn.microsoft.com/en-us/magazine/cc163532.aspx
http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReadWriteLock.html
http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html
http://code.activestate.com/recipes/413393/
http://tutorials.jenkov.com/java-concurrency/read-write-locks.html
http://www.cs.ru.nl/bachelorscripties/2007/Bernard_van_Gastel___Reliability_of_a_read-write_lock_implementation.pdf
http://www.jdocs.com/transaction/1.1/org/apache/commons/transaction/locking/ReadWriteLock.html
http://www.boost.org/doc/libs/1_39_0/doc/html/thread/synchronization.html
 

Dodano 2010-06-24:
http://cit.srce.hr/index.php/CIT/article/viewFile/1561/1265
http://www.cs.arizona.edu/classes/cs522/spring09/papers/rw.pdf
 

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Reader Writer Lock
  • Blog
  • 344 odsłony

Performance Profiling Without the Overhead

published by Kuling on pt., 2009-07-24 22:31

http://forums.amd.com/devblog/blogpost.cfm?catid=208&threadid=116487
http://developer.amd.com/cpu/LWP/Pages/default.aspx

Kategorie: 
Concurrency
Narzędzia
Programowanie
  • Czytaj dalej wpis Performance Profiling Without the Overhead
  • Blog
  • 251 odsłon

The ReaderWriterGate Lock

published by Kuling on sob., 2009-07-25 18:18

Cytat:
What I'd like to do now is explain the idea behind the ReaderWriterGate, discuss a possible implementation, and offer a slightly new way of thinking about threading and thread synchronization in general. It is my hope that you will see places in your existing code where this kind of thinking can be applied so that with minimal re-architecting, you could incorporate some of these ideas to give your applications better performance and scalability.

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

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis The ReaderWriterGate Lock
  • Blog
  • 169 odsłon

Windows Thread Scheduling by priorities

published by Kuling on sob., 2009-07-25 18:31

Cytat:
The system treats all threads with the same priority as equal. The system assigns time slices in a round-robin fashion to all threads with the highest priority. If none of these threads are ready to run, the system assigns time slices in a round-robin fashion to all threads with the next highest priority. If a higher-priority thread becomes available to run, the system ceases to execute the lower-priority thread (without allowing it to finish using its time slice), and assigns a full time slice to the higher-priority thread. For more information, see Context Switches.

http://msdn.microsoft.com/en-us/library/ms685100%28VS.85%29.aspx

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis Windows Thread Scheduling by priorities
  • Blog
  • 175 odsłon

Threads scheduling - priority boost

published by Kuling on sob., 2009-07-25 22:03

Cytat:
Each thread has a dynamic priority. This is the priority the scheduler uses to determine which thread to execute. Initially, a thread's dynamic priority is the same as its base priority. The system can boost and lower the dynamic priority, to ensure that it is responsive and that no threads are starved for processor time. The system does not boost the priority of threads with a base priority level between 16 and 31. Only threads with a base priority between 0 and 15 receive dynamic priority boosts.

http://msdn.microsoft.com/en-us/library/ms684828%28VS.85%29.aspx

Cytat:
Another situation causes the system to dynamically boost a thread's priority level. Imagine a priority 4 thread that is ready to run but cannot because a priority 8 thread is constantly schedulable. In this scenario, the priority 4 thread is being starved of CPU time. When the system detects that a thread has been starved of CPU time for about three to four seconds, it dynamically boosts the starving thread's priority to 15 and allows that thread to run for twice its time quantum. When the double time quantum expires, the thread's priority immediately returns to its base priority.

Cytat:
When the user works with windows of a process, that process is said to be the foreground process and all other processes are background processes. Certainly, a user would prefer the process that he or she is using to behave more responsively than the background processes. To improve the responsiveness of the foreground process, Windows tweaks the scheduling algorithm for threads in the foreground process. For Windows 2000, the system gives foreground process threads a larger time quantum than they would usually receive. This tweak is performed only if the foreground process is of the normal priority class. If it is of any other priority class, no tweaking is performed.

Programming Applications for Microsoft Windows, Jeffery Richer
Rozdział 7, Cam Programming Priorities
http://www.amazon.com/Programming-Applications-Microsoft-Windows-General/dp/1572319968


 

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Threads scheduling - priority boost
  • Blog
  • 267 odsłon

Intel 64 Architecture Memory Ordering

published by Kuling on wt., 2009-07-28 21:26

Intel 64 memory ordering guarantees that for each of the following memory-access instructions, the constituent memory operation appears to execute as a single memory access regardless of memory type:

  1. Instructions that read or write a single byte.
  2. Instructions that read or write a word (2 bytes) whose address is aligned on a 2 byte boundary.
  3. Instructions that read or write a doubleword (4 bytes) whose address is aligned on a 4 byte boundary.
  4. Instructions that read or write a quadword (8 bytes) whose address is aligned on an 8  byte boundary.

All locked instructions (the implicitly locked xchg instruction and other read-modify-write  instructions with a lock prefix) are an indivisible and uninterruptible sequence of load(s) followed by store(s) regardless of memory type and alignment.
Other instructions may be implemented with multiple memory accesses. From a memory ordering point of view, there are no guarantees regarding the relative order in which the constituent memory accesses are made. There is also no guarantee that the constituent operations of a store are executed in the same order as the constituent operations of a load

Intel 64 memory ordering obeys the following principles:

  1. Loads are not reordered with other loads.
  2. Stores are not reordered with other stores.
  3. Stores are not reordered with older loads.
  4. Loads may be reordered with older stores to different locations but not with older
    stores to the same location.
  5. In a multiprocessor system, memory ordering obeys causality (memory ordering
    respects transitive visibility).
  6. In a multiprocessor system, stores to the same location have a total order.
  7. In a multiprocessor system, locked instructions have a total order.
  8. Loads and stores are not reordered with locked instructions.

http://www.multicoreinfo.com/research/papers/2008/damp08-intel64.pdf

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis Intel 64 Architecture Memory Ordering
  • Blog
  • 237 odsłon

Actor Model Concurrency

published by Kuling on śr., 2009-07-29 07:36

Cytat:
When it comes to programming models, everyone’s favorite whipping boy is the model where access to shared memory is controlled using locks or their close relatives (e.g. semaphores, condition variables). To be sure, this approach is fraught with peril – race conditions, deadlock, livelock, thundering herds, indefinite postponement, lock or priority inversion, and the list just keeps going. The funny thing is that most of these don’t really go away with any of the programming models that are proposed as solutions (including the actor model). For example, software transactional memory is what all the Cool Kids talk about the most. It’s a good model, with many advantages over lock-based programming, but a program can still deadlock at a higher level even if it’s using STM to avoid deadlock at a lower level. There’s an old saying that a bad programmer can write Fortran in any language, and it’s equally true that a bad programmer can create deadlock in any programming model.

http://pl.atyp.us/wordpress/?p=2204

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis Actor Model Concurrency
  • Blog
  • 206 odsłon

Scale up or scale out?

published by Kuling on czw., 2009-07-30 21:06

Cytat:
Listening to the questions, from the audience and conversations after, one thing was clear - this is a complex challenge that even smart, experienced people struggle to do well.  When moving toward developing software in a parallel environment, there are a lot of things to consider, a lot of questions come up.

How do I train my developers? 
Can I reuse what I have or do I have to rewrite?
What tools should I use?

http://www.roguewave.com/blog/scale-up-or-scale-out/

Kategorie: 
Concurrency
Programowanie
  • Czytaj dalej wpis Scale up or scale out?
  • Blog
  • 213 odsłon

C++0x working draft

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

1300 stron. Chyba zejdzie trochę czasu na czytanie :)

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2914.pdf

Kategorie: 
C++
Programowanie
  • Czytaj dalej wpis C++0x working draft
  • Blog
  • 232 odsłony

C++ is a superpower

published by Kuling on pt., 2009-07-31 17:09
  • C++ Garbage Collection
  • Memory Model
  • Atomics

http://www.thegibson.org/blog/archives/303

Kategorie: 
C++
Concurrency
Programowanie
  • Czytaj dalej wpis C++ is a superpower
  • Blog
  • 226 odsłon

Archiwum

  • 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 (172)
      • 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