- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Problem in threading (HP Digital)
Operating System - OpenVMS
1753510
Members
4867
Online
108795
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2011 06:39 AM
тАО03-01-2011 06:39 AM
Problem in threading (HP Digital)
Hi,
We have a mutlithreaded application into which we recently done some modifications . we are calling a function "X" from function thread "Y" and we are passing a structure from Y to X and in this X we are just doing a copy of one integer variable from the structure to a char pointer using scanaf. Whats happening is after processing some records these threads are not able to copy integer value to char*.
When we printed the integer variable its comming properly but i dont understand why then it is not able to copy it. Can any one please tell what could be the reason for this phenomenon. Do i need to declare the variables in volatile or somethingelse i need to do.
Thanks
Anup
We have a mutlithreaded application into which we recently done some modifications . we are calling a function "X" from function thread "Y" and we are passing a structure from Y to X and in this X we are just doing a copy of one integer variable from the structure to a char pointer using scanaf. Whats happening is after processing some records these threads are not able to copy integer value to char*.
When we printed the integer variable its comming properly but i dont understand why then it is not able to copy it. Can any one please tell what could be the reason for this phenomenon. Do i need to declare the variables in volatile or somethingelse i need to do.
Thanks
Anup
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2011 07:49 AM
тАО03-01-2011 07:49 AM
Re: Problem in threading (HP Digital)
"it is not able to copy it"
Haha, perfect symptom description.
/Guenther
Haha, perfect symptom description.
/Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2011 11:02 AM
тАО03-01-2011 11:02 AM
Re: Problem in threading (HP Digital)
Anup,
This is a very vague definition of a problem. In a multi-threaded environment, there are a large number of ways in which problems with this or similar descriptions can occur.
A careful review of the sources is in order. Having done this in the past many times, it is not possible to know if the problem is a shortcoming of the modifications, or an error in the original code that is exposed by the changes. Also note that the definitions of the C RTL routines should be checked to make sure that they are "thread safe".
- Bob Gezelter, http://www.rlgsc.com
This is a very vague definition of a problem. In a multi-threaded environment, there are a large number of ways in which problems with this or similar descriptions can occur.
A careful review of the sources is in order. Having done this in the past many times, it is not possible to know if the problem is a shortcoming of the modifications, or an error in the original code that is exposed by the changes. Also note that the definitions of the C RTL routines should be checked to make sure that they are "thread safe".
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2011 07:44 PM
тАО03-01-2011 07:44 PM
Re: Problem in threading (HP Digital)
I haven't heard of the scanaf() function, and there's no mention of it in the CRTL manual. Do you mean sscanf()?
If so, it seems to me you are using the wrong routine: the input to sscanf() is a pair of strings, the output is whatever the first string represents (be it integers, floats or other strings).
In other words, I don't think you would ever use sscanf() to "copy integer value to char*". I would have thought sprintf() would be better for that.
Regards,
Jeremy Begg
If so, it seems to me you are using the wrong routine: the input to sscanf() is a pair of strings, the output is whatever the first string represents (be it integers, floats or other strings).
In other words, I don't think you would ever use sscanf() to "copy integer value to char*". I would have thought sprintf() would be better for that.
Regards,
Jeremy Begg
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP