Comments (5)
It may be better to use "0x%lx" to print thread id on macOS because dtruss -l
prints thread ids as hexadecimal as follows.
(8900 == 0x22c4)
$ curl -O https://raw.githubusercontent.com/kubo/test-code-collection/d510543/unix/get_thread_id.c
$ cc -o get_thread_id get_thread_id.c
$ sudo dtruss -l ./get_thread_id
pthread_self = 0x7fff73341000
thread_id = 8900
PID/THRD SYSCALL(args) = return
845/0x22c4: thread_selfid(0x0, 0x0, 0x0) = 8900 0
845/0x22c4: open(".\0", 0x0, 0x1) = 3 0
845/0x22c4: fstat64(0x3, 0x7FFF55DBE760, 0x1) = 0 0
...
When thread ids in odpi debug output are formatted as hexadecimal number, it is easy to compare them with thread ids in dtruss output.
from odpi.
Thanks, Kubo. The note about date format is well taken. I can make that change. The call to get the thread id on Linux can be implemented easily enough as well as the one for macOS. I avoided them to this point to ensure I didn't have any problems with portability, but it would be nicer to have the OS specific details available. @cjbj, do you have a comment on the macOS comment regarding dtruss? Or any of the other suggestions made here?
from odpi.
The date format and thread id format have been changed as suggested. On macOS I did not change the thread id format to hexadecimal -- at least not yet. I'll wait to see if there are other cases where the decimal representation is preferred -- and then decide whether to change it wholesale to hexadecimal or allow for both options in some way. Reasonable?
from odpi.
There may be other cases where decimal is preferred as you wrote. I don't know tools on macOS other than dtruss. I have not used GUI developer tools on macOS.
Decimal representation on macOS is okay for me. It is easy to convert decimals to hexadecimals and vice versa.
FYI: strace -f
on Linux printed decimal thread ids as follows.
$ wget https://raw.githubusercontent.com/kubo/test-code-collection/0ca71eb/unix/get_thread_id.c
$ cc -o get_thread_id get_thread_id.c -pthread
$ strace -f -e trace=gettid -o strace.log ./get_thread_id
main : pthread_self = 139933633832704
main : thread_id = 15626
child: pthread_self = 139933625562880
child: thread_id = 15627
$ cat strace.log
15626 gettid() = 15626
15627 gettid() = 15627
15627 +++ exited with 0 +++
15626 +++ exited with 0 +++
from odpi.
In that case we'll close this. If it becomes clear later on that hexadecimal representation is more useful in certain cases, please open a new issue. Thanks!
from odpi.
Related Issues (20)
- XMLTYPE as "real" XML HOT 3
- Ability to set OCI_ATTR_LOBPREFETCH_SIZE HOT 7
- "ORA-03106: fatal two-task communication protocol error" when CLOB is fetched as strings and then lob locators HOT 3
- core dumps generated in libclntsh when timeouts are configured HOT 10
- Any plan to support Apple's M1 plat? HOT 1
- Is there a reference example dequeue message with message ID dequeue option HOT 9
- When ODPI tries to translate a variable to a temporary LOB, and there is inadequate TEMP tablespace, ODPI segfaults when the cursor is closed HOT 6
- M1 Mac issue ( incompatible architecture) HOT 2
- How to use ODPI-C with Oracle Times Ten? HOT 9
- Column Alias Error HOT 7
- Add an option to convert numbers between double and decimal in the same way as node.js, python3, ruby, rust or so HOT 5
- Oracle Rust driver HOT 2
- Option to get json float as float. It is got as double now. HOT 8
- Bytes after nul in members of dpiXid are zeroed. HOT 2
- Is DPI_TPC_END_SUSPEND an undocumented flag in the OCI manual? HOT 3
- dpiEnqOptions_setVisibility and dpiLob_getType are listed not in round_trips.rst HOT 2
- Get column name for position HOT 2
- `dpiStmt_execute` with `DPI_MODE_EXEC_PARSE_ONLY` will create a table. HOT 4
- Retrieving CLOB from an OUT parameter of an Store Procedure HOT 1
- ERROR: DPI-1047: Cannot locate a 32-bit Oracle Client library HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odpi.