boostorg / boostorg/interprocess

Getting bootup time on Windows is not stable

Aperta
#96 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
185
Fork
131
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Bootup time is needed in boost::interprocess for creating a unique shared directory which remains identical for all processes started since last reboots, but different between reboots. Currently people have choice to get the bootup time by define following macros:
```
1. BOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME (not recommended due to instability with time synchronization and hibernation and unusable in practice)
2. BOOST_INTERPROCESS_BOOTSTAMP_IS_EVENTLOG_BASED (It's a default method, if none of the macro is defined, fetches bootup time from system event log, Id 6005)
3. BOOST_INTERPROCESS_BOOTSTAMP_IS_SESSION_MANAGER_BASED (fetches bootup time from registry setting, path : HKEY_LOCAL_MACHINE→ SYSTEM → CurrentControlSet → Control → Session Manager → Memory Management → PrefetchParameters → BootID)
```

The problem with 2 & 3 is that if the Windows system event log with ID 6005 and registry key BootID gets deleted then the application throws runtime exception. We have already been notified of these issues by different users of our application and hence the idea is to propose a new method which can be used on Windows OS that supports of:

```
* Minimum supported client -> Windows Vista
* Minimum supported server -> Windows server 2008
```
Since this issue is in existence from long time and for those who are using newer Windows OS, provide them the flexibility to use GetTickCount64 for calculating bootup time by define a new preprocessor macro `BOOST_INTERPROCESS_BOOTSTAMP_IS_GETTICKCOUNT64_BASED `in `boost/interprocess/detail/win32_api.hpp`

I have added a patch for having a better view of suggested change. Please provide your feedback if the change can be pulled into Boost. If so I can submit a PR for this.

![my_patch1](https://user-images.githubusercontent.com/26009849/65743138-f05f1400-e110-11e9-9324-402a8847db2f.JPG)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Iniziare da boost/interprocess/detail/win32_api.hpp e rivedere le macro di selezione di bootstamp esistenti e le implementazioni specifiche per Windows. Verificare come dovrebbe comportarsi l’opzione proposta BOOST_INTERPROCESS_BOOTSTAMP_IS_GETTICKCOUNT64_BASED su Windows Vista e Windows Server 2008. Il lavoro è completato quando la nuova opzione fornisce un bootstamp stabile senza dipendere da Event Log ID 6005 o dal valore del registro BootID.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
operating-systems
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.