Lamport Timestamps: When to Update Counters
Considering that any local action (e.g. increasing a counter) done by a process is an event, the Wikipedia sentence


  "A process increments its counter before each event in that process." 


does not make any sense to me. Let me try to answer your questions:


  
  Should we increment the counter before sending a message, as the sending of a message is itself an event. This incremented timestamp is the value that is sent with the message.
  


Both actions (i.e. increasing the counter and sending the message) happen atomically in the same event. The same is true when a message is received: The receive event already includes the counter update.  


  
  When a message is received by process Pi Lamport states that Pi logical clock should be set to max(Tm+1,Ci). However, the Wikipedia article says that this should be max(Tm,Ci)+1. Is Wikipedia wrong?
  


Note that, according to Lamport's paper, the logical clocks must satisfy the following property: 


  If $a$ happens before $b$ then $C(a) &lt; C(b)$.


In particular, this means that clock values (of events) at the same process must be strictly increasing.
Therefore, the correct update rule is $\max(Tm,Ci)+1$, as otherwise two subsequent events at the same process might have the same value.