HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: problem about performance
Operating System - HP-UX
1833793
Members
2895
Online
110063
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
Forums
Discussions
Discussions
Discussions
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
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
08-15-2001 11:03 PM
08-15-2001 11:03 PM
problem about performance
Thread A writes data into a queue which can be devided into N slots,
thread B read from it.
If two semaphores of value 1 are associated with the queue, one for
full and one for empty, then A and B can access the queue multual
exclusively. On double CPU machine, this program has low performance.
If two semaphores of value N are associated with the queue, one for
full slots and one for empty slots, A and B can access the queue
simultaneously. But if B sem_wait(fcnt) and block, then A write data
into the queue. At this time, B is runnable and waked up. Each time A
write a data slot into the queue, context switch may occurs. It wastes
a lot of CPU time.
How can I design the program so that the two threads can run
simultaneously to use the two CPU, at the same time, context switch is
not frequently ?
By the way, do I need to do something such as binding threads into
individual CPU so that two threads can run simultaneously to use the
two CPU ?
thread B read from it.
If two semaphores of value 1 are associated with the queue, one for
full and one for empty, then A and B can access the queue multual
exclusively. On double CPU machine, this program has low performance.
If two semaphores of value N are associated with the queue, one for
full slots and one for empty slots, A and B can access the queue
simultaneously. But if B sem_wait(fcnt) and block, then A write data
into the queue. At this time, B is runnable and waked up. Each time A
write a data slot into the queue, context switch may occurs. It wastes
a lot of CPU time.
How can I design the program so that the two threads can run
simultaneously to use the two CPU, at the same time, context switch is
not frequently ?
By the way, do I need to do something such as binding threads into
individual CPU so that two threads can run simultaneously to use the
two CPU ?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2001 11:21 PM
08-15-2001 11:21 PM
Re: problem about performance
Hi
Performance of your program will improve if the threads are made to run different CPU.
You can make use of the mpctl function in C to make the threads run on different CPU's
it is used as
mpctl(MPC_SETLWP,cpu,lwpid)
Check man mpctl
Hope this helps...
...BPK...
Performance of your program will improve if the threads are made to run different CPU.
You can make use of the mpctl function in C to make the threads run on different CPU's
it is used as
mpctl(MPC_SETLWP,cpu,lwpid)
Check man mpctl
Hope this helps...
...BPK...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2001 06:43 PM
08-22-2001 06:43 PM
Re: problem about performance
Why I could not find the button th assign the point ?
I am very sorry.
I am very sorry.
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.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP