209 // Return current local time in a string (YYYY-MM-DD HH:MM:SS).
210 // It is MT safe, but not async-safe, as reading time zone
211 // information may require a lock on some platforms.
212 static char* local_time_string(char *buf, size_t buflen);
213 static struct tm* localtime_pd (const time_t* clock, struct tm* res);
214 static struct tm* gmtime_pd (const time_t* clock, struct tm* res);
215 // Fill in buffer with current local time as an ISO-8601 string.
216 // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz.
217 // Returns buffer, or NULL if it failed.
218 static char* iso8601_time(char* buffer, size_t buffer_length, bool utc = false);
219
220 // Interface for detecting multiprocessor system
221 static inline bool is_MP() {
222 // During bootstrap if _processor_count is not yet initialized
223 // we claim to be MP as that is safest. If any platform has a
224 // stub generator that might be triggered in this phase and for
225 // which being declared MP when in fact not, is a problem - then
226 // the bootstrap routine for the stub generator needs to check
227 // the processor count directly and leave the bootstrap routine
228 // in place until called after initialization has ocurred.
229 return AssumeMP || (_processor_count != 1);
230 }
231 static julong available_memory();
232 static julong physical_memory();
233 static bool has_allocatable_memory_limit(julong* limit);
234 static bool is_server_class_machine();
235
236 // Returns the id of the processor on which the calling thread is currently executing.
237 // The returned value is guaranteed to be between 0 and (os::processor_count() - 1).
238 static uint processor_id();
239
240 // number of CPUs
241 static int processor_count() {
242 return _processor_count;
243 }
244 static void set_processor_count(int count) { _processor_count = count; }
245
246 // Returns the number of CPUs this process is currently allowed to run on.
247 // Note that on some OSes this can change dynamically.
248 static int active_processor_count();
249
250 // At startup the number of active CPUs this process is allowed to run on.
|
209 // Return current local time in a string (YYYY-MM-DD HH:MM:SS).
210 // It is MT safe, but not async-safe, as reading time zone
211 // information may require a lock on some platforms.
212 static char* local_time_string(char *buf, size_t buflen);
213 static struct tm* localtime_pd (const time_t* clock, struct tm* res);
214 static struct tm* gmtime_pd (const time_t* clock, struct tm* res);
215 // Fill in buffer with current local time as an ISO-8601 string.
216 // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz.
217 // Returns buffer, or NULL if it failed.
218 static char* iso8601_time(char* buffer, size_t buffer_length, bool utc = false);
219
220 // Interface for detecting multiprocessor system
221 static inline bool is_MP() {
222 // During bootstrap if _processor_count is not yet initialized
223 // we claim to be MP as that is safest. If any platform has a
224 // stub generator that might be triggered in this phase and for
225 // which being declared MP when in fact not, is a problem - then
226 // the bootstrap routine for the stub generator needs to check
227 // the processor count directly and leave the bootstrap routine
228 // in place until called after initialization has ocurred.
229 return (_processor_count != 1);
230 }
231
232 static julong available_memory();
233 static julong physical_memory();
234 static bool has_allocatable_memory_limit(julong* limit);
235 static bool is_server_class_machine();
236
237 // Returns the id of the processor on which the calling thread is currently executing.
238 // The returned value is guaranteed to be between 0 and (os::processor_count() - 1).
239 static uint processor_id();
240
241 // number of CPUs
242 static int processor_count() {
243 return _processor_count;
244 }
245 static void set_processor_count(int count) { _processor_count = count; }
246
247 // Returns the number of CPUs this process is currently allowed to run on.
248 // Note that on some OSes this can change dynamically.
249 static int active_processor_count();
250
251 // At startup the number of active CPUs this process is allowed to run on.
|