Buffer Management and Threads
Hi,
I'm trying to program an audio editor for wav files. At the moment I am struggling to handle playing the large files. I want to implement some sort of buffer management, possibly LRU.
As one buffer is playing, I need another buffer to read in the next block of the sound file and get ready to play it. I then need the blocks to play seamlessly I.e. no gap in sound output when the SourceDataLine is changing from one buffer to another.
Eventually I need a set number of fixed size buffers to play without the user being able to hear the transitions.
Does anybody have any ideas about where to start?
Any help would be greatly appreciated, I'm really stuck!
Jimbo
I don't mean I'm experiencing any gaps in playback, i mean I need to code a system that manages a certain number of buffers, and manages to play transitions between buffers seamlessy - i.e. without noticing.
The following is my code for the Thread that writes the data to the SourceDataLine.
class PlayThread extends Thread {
int bufLen = frameSize*bufferFrames/2;
byte[] aBuffer = new byte[bufLen];
public void run() {
int counter;
playButton.setEnabled(false);
try {
sDL.open(format);
sDL.start();
while((counter = theStream.read(
aBuffer,0,aBuffer.length)) != -1 && currentlyPlaying == false){
if(counter > 0){
CurrentTime = currentFrame / frameRate;
System.out.println("Timer : "+currentTime+" "+counter+" Bytes");
sDL.write(aBuffer, 0, counter);
currentFrame = currentFrame + framesReadSoFar;
sDL.drain();
sDL.close();
playButton.setEnabled(true);
} catch (Exception e) {
System.out.println(e);
}
Similar Messages
-
Hello !
Does the counter of event buffer gets include the logical reads ?
Does the mertic buffer gets include the event of reading from undo buffer ?
Thanks and regards,
Pavel
Edited by: Pavel on Jun 27, 2012 3:08 AM
Edited by: Pavel on Jun 27, 2012 3:35 AM
Edited by: Pavel on Jun 27, 2012 4:13 AMHi,
buffer gets = number of times a block was requested from buffer cache. A buffer get always request in a logical read. Depending on whether or not a copy of the block is available in the buffer cache, a logical read may or may not involve a physical read. So "buffer gets" and "logical reads" are basically synonyms and are often used interchangeably.
Oracle doesn't have a special "undo buffer". Undo blocks are stored in rollback segments in UNDO tablespace, and are managed in the same way data blocks are (they're even protected by redo). If a consistent get requires reading from UNDO tablespace, then statistics counters will show that, i.e. there will be one more consistent get in your autotrace.
For more information and some examples, see a thread at askTom:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:549546900346542976
Best regards,
Nikolay -
App-V 5 sp2, Citrix user profile manager and Event IDs 19104
Hi,
the environment:
Full Infrastructure, Appv 5 sp2 Client on server 2008r2, xenapp 6.5 and Citrix user profile manager.
We get the event error 19104 on published packages. But not on all users. %APPDATA%\Microsoft\AppV\Client\VFS and %LOCALAPPDATA%\Microsoft\AppV\Client\VFS are excluded per
http://blogs.technet.com/b/appv/archive/2013/10/01/support-tip-event-ids-19104-and-19105-are-logged-when-publishing-and-unpublishing-app-v-5-0-packages.aspx from my test GPO:
List of directories to exclude:
AppData\Local\Microsoft\AppV
AppData\Roaming\Microsoft\AppV\Client
Appdata\local
appdata\locallow
Still some users get app-v Applications, but some that are copies of the ones working does not get the Applications. I have tried to delete the profile. but still no closer to a solution. Anyone got this working?Thanks Nicke, I should have tried harder to get you to come and work with me in Oslo earlier this year ;)
That thread does point on the Profile managment, and redirection of %appdata% and %localappdata% . Those to folders are not redirected. But when i run Procmon, i can see that a working user creates the c:\users\<username>\appdata\local\temp but non
working does not even try.Non working users also does not query the registry as much as working. Ofcourse this all work in my lab so the settings should be sound. but i cannot find the smoking environment variable or setting that causes it. -
What is the relationship between Change management and Issue tracking?
What is in general change management and what is issue tracking in a SAP point of view?
Hi
See this thread
Re: SAP APO
Additional inputs :
APO refers Advanced planned and optimizer
APO is similar to BW in the sense it is also a OLAP processor intended for reporting needs
Supply chain management
http://help.sap.com/saphelp_nw2004s/helpdata/en/25/79eb3cad744026e10000000a11405a/frameset.htm -
made in cosmos help please need it
using System;
using Cosmos.Compiler.Builder;
using System.Threading;
using System.Windows.Forms;
namespace IUOS
class Program
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
BuildUI.Run();
#endregion
// Main entry point of the kernel
public static void Init()
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.ForegroundColor = ConsoleColor.DarkBlue;
a:
Console.WriteLine("------------------------------");
Console.WriteLine("WELCOME TO THE NEWLY OS MADE BY THE STUDENTS OF IQRA UNIVERSITY!");
Console.WriteLine("------------------------------");
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("\t _____
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |___________");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t| | | |
| | |");
Console.WriteLine("\t|_____| |____________| |____________| ____________");
string input;
Console.WriteLine();
Console.Write("\nAbout OS : a");
Console.Write("\nTo Shutdown : s");
Console.Write("\nTo Reboot : r");
Console.Write("\nStart Windows Normaly : n");
Console.WriteLine();
input = Console.ReadLine();
if (input == "s" || input == "S"){
Cosmos.Sys.Deboot.ShutDown();
else
if (input == "r" || input == "R"){
Cosmos.Sys.Deboot.Reboot();
else
if (input == "a" || input == "A"){
Console.ForegroundColor = ConsoleColor.DarkBlue;
Console.Clear();
Console.WriteLine("\n\n\n-------------------------------------");
Console.WriteLine("version: DISPLAYS OS VERSION");
Console.WriteLine("about: DISPLAYS INFO ABOUT ANGRY OS");
Console.WriteLine("hello or hi: DISPLAYS A HELLO WORLD");
Console.WriteLine("MESSAGE THAT WAS USED TO TEST THIS OS!!");
Console.WriteLine("-----------------------------------");
Console.Write("You Want to know : ");
input = Console.ReadLine();
if (input == "version"){
Console.WriteLine("--------------------");
Console.WriteLine("OS VERSION 0.1");
Console.WriteLine("--------------------");
else
if (input == "about"){
Console.WriteLine("--------------------------------------------");
Console.WriteLine("OS IS DEVELOPED BY Qazi Jalil-ur-Rahman & Syed Akber Abbas Jafri");
Console.WriteLine("--------------------------------------------");
Console.Write("Want to go back to the main window");
Console.Write("\nYes : ");
string ans = Console.ReadLine();
if (ans == "y" || ans == "Y")
goto a;
Thread.Sleep(10000);
else
if (input == "n" || input == "N")
Thread.Sleep(5000);
Console.Clear();
for (int i = 0; i <= 0; i++){
Console.Write("\n\n\n\n\t\t\t\t\t ____ ____ ___
Console.Write("\n\t\t|\t\t | | | |
| | | | | |");
Console.Write("\n\t\t|\t| | |---- | |
| | | | | |---");
Console.Write("\n\t\t|____|____| |____ |___ |____ |___| | | |___");
Thread.Sleep(500);
Thread.Sleep(5000);
Console.Clear();
BootUserInterface();
Console.ReadLine();
// Form1 fo = new Form1();
else{
for (int i = 0; i <= 5; i++){
Console.Beep();
Thread.Sleep(1000);
goto a;
while (true);
private static void BootUserInterface() {
Thread t = new Thread(UserInterfaceThread);
t.IsBackground = true;
t.SetApartmentState(ApartmentState.STA);
t.Start();
private static void UserInterfaceThread(object arg) {
Form1 frm = new Form1(); // use your own
Application.Run(frm);
Hi
Jalil Cracker,
>>when user pres n then it must go to a form but error arises and not working good and threading is not respondin
Could you post the error information? And which line caused this error?
If you want to show Form1, you can use form.show() method
Form1 frm = new Form1();
frm.Show();
In addition, Cosmos is an acronym for C# Open Source Managed Operating System. This is not Microsoft product.If the issue is related to Cosmos, it would be out of our support. Thanks for your understanding. And you need raise an issue at Cosmos site.
Best regards,
kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Work manager using thread.sleep or delay doesn't work
Hi all,
I used Spring framework and oracle weblogic 10.3 as a container.
I used workmanager for manage my thread, I already made one thread that managed by workmanager. Fortunately spring provide the delegation class for using workmanager, so I just need to put it on applicationContext.xml.
But when I put the "while" and TimeUnit for sleep the process on desired delayed time, the deployment process never finished. It seems the deployment process never jump out from while loop for finishing the deployment.
Why?, As I know using typical thread, there is no issue like this. Should I use another strategy for make it always loop and delay.
This is my simple code :
import java.util.concurrent.TimeUnit;
import org.springframework.core.task.TaskExecutor;
public class TaskExecutorSample{
Boolean shutdown = Boolean.FALSE;
int delay = 8000;
TimeUnit unit = TimeUnit.SECONDS;
private class MessageGenerator implements Runnable {
private String message;
public MessageGenerator(String message){
this.message = message;
@Override
public void run() {
System.out.println(message);
private TaskExecutor taskExecutor;
public TaskExecutorSample(TaskExecutor taskExecutor){
this.taskExecutor = taskExecutor;
try {
while (shutdown.equals(Boolean.FALSE)){
this.printMessage();
unit.sleep(delay);
} catch (Exception e) {
System.out.println(e.getMessage());
public void printMessage() {
taskExecutor.execute(new MessageGenerator("Print this Messages"));
Really thanks in advance.
Regards,
Kahlil
Edited by: Kahlil on May 26, 2010 2:38 PM
Edited by: Kahlil on May 26, 2010 2:42 PMHi,
i m not sure whether it's an issue with Spring or not. But i tried using Thread.sleep(1000) in a Simple webapplication to see Workmanagers works properly or not. I found that it works extremely great: http://weblogic-wonders.com/weblogic/2010/01/24/workmanager-at-webapplication-level/
Thanks
Jay SenSharma -
Desktop Manager and Content Protection
Hi,
We've enabled content protection across all our devices via an IT policy. We are noticing that now, when some users try to connect to their devices via the desktop manager, the manager hangs.
Is this just a coincidence or is there problems connecting to devices with content protection enabled?I'm glad I found this thread.
I loaded the Desktop Manager and Roxio Media Manager 2 days ago. It completely crippled my laptop (running Vista, 4GB RAM etc), which previously ran very well.
I suspected it was Roxio when I watched it take 20 minutes to install.
Worringly, my laptop was crippled without the Desktop or Roxio software being used. The response rate was once every 5 minutes, and when eventually getting to the Task Manager and looking at the Processes and Applications (a 15 minute job!), there was nothing untoward.
Having uninstalled them and rebooted, the laptop is back to its former glory so quite what Roxio was doing in the background, I have no idea. I won't be touching it again.
Matt
Message Edited by mjsulliva on 04-03-2009 05:13 AM -
Weblogic Enterprise 5.1 and threads
I know when building servers based on WLE 4.2 in was a big no-no to link in threading libraries like pthread and thread. Is this still the case in Weblogic Enterprise 5.1?
According to the product information, WLE 5.1 does not support Oracle 8.1.6, it
only goes up to
Oracle 8.1.5. But in general, I thought that with oracle there are 2 sets of
libraries, one for threads and
one for non-threaded support. You need to use the correct one, in the case of
WLE, that would be the
non-threaded one.
MAS
Paul Power wrote:
Thanks Mary,
Do you know of any customers who have managed to work
with Oracle 8.1.6 without linking with the thread libraries ?
cheers,
P.
Mary Ann Slavin wrote in message <[email protected]>...
WLE 5.1 C++ is not a threaded product. Compiling WLE 5.1 C++ with thread
libraries is not supported and will give unpredictable results for allprograms.
This should not be done.
Paul Power wrote:
Hi Mary,
Is it a dictate from BEA that you "can't" link with thread libraries ?
We are using WLE 5.0.1 ( and some 5.1) with Oracle 8.1.6 on
Solaris and found that we had to link using -lthread in order to use
Oracle (not the case in 8.1.5)
We don't actually attempt to try any threading in our apps and
have not had any problems yet but if it's the case that there
are known problems using threads we'd love to hear about
them :-)
As an aside, is Oracle 8.1.6 cleared for use by WLE ?
P.
Mary Ann Slavin wrote in message <[email protected]>...
No matter how WLE 5.1 C++ is used, it cannot be compiled with threadedlibraries, so that restriction remains.
A WLE C++ server can act as a client and call a WLE Java Server. Doingthis does not require the WLE C++ server to be compiled with threaded
libraries.
Wendell MacKenzie wrote:
Does this also mean if CORBA C++ servers want to invoke threaded
JavaServers
the same DEFECT will be prevent this from being accomplished?
Mary Ann Slavin wrote:
WLE 5.1 does not have threads in the C++ clients or servers. Java
threads are naturally occuring in the language, however, there are WLE
restrictions on what can be done in the
Java threads. These are documented.
jd wrote:
I know when building servers based on WLE 4.2 in was a big no-no
to
link in threading libraries like pthread and thread. Is this still thecase
in Weblogic Enterprise 5.1?
> -
Hi all
one question: is it possible to make CRM loyalty management and ECC sales orders work together?
I.e.: If I make a sale order in ECC will the system be able to send the data to CRM in order to make the loyalty engine (rules and so on) running?
Up to now I am not interested on how it is possible to achieve this, but only if it is possible to do it.
If you also know how...well...share your knowledge
Many many thanks
PierluigiHi Pierluigi,
I know this is quite an old post, but I am just getting into the same subject myself. I was going through SAP Note 1331970 - Loyalty Sales order setup document which clearly states that Loyalty Management is only integrated with CRM Billing. As far as I can understand the loyalty point calculation is happening off the back of the CRM billing. So if you have ECC sales orders it is not going to work.
I assume you have realized this by know. If you have some time, can you please update this thread what the solution was in your implementation?
Regards,
Csongor -
Applications Management and Change Management Packs Certified with EM 10gR5
Applications Management and Change Management Packs Certified with Enterprise Manager Grid Control Release 5
For more details about the new features, documentation, and patches for the latest Application Management Pack and Application Change Management Pack releases, see:
[Applications Change Management Pack 3.0 and Applications Management Pack 3.0 Now Available|http://forums.oracle.com/forums/thread.jspa?threadID=935145&tstart=0]
Oracle E-Business Suite Prerequisites
11.5.10 with ATG_PF.H RUP5 and higher
Release 12.0.4 and higher
Release 12.1
Certified Platforms
Linux x86
Linux x86-64
Sun Solaris SPARC
HP-UX Itanium
HP-UX PA-RISC
IBM AIX Based Systems
Certification on Windows platforms is in progress.It takes me a lof of time to comprehend the sentence you write. Cause I am a Chinese. My poor English.
I have to say "you are genius". I used to use the indesign CS2. There is no GREP function in CS2. When I get the new script, I do not know how to use it. Just when I saw the
'grep {findWhat:" +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.'
Being confused.
Thanks so much. It seems I have to relearn the advanced Indesign. -
Mismatch in system number on Solution manager and SMP
Hi All,
I found System Id is different in Solution manager and Service Market Place. But where as System number is same in Satellite system and Solution manager. Because system is not same we are unable to send he solution to SAP. Please suggest how to make system id same on SMP and both satellite system and solution manager.
Regard's
SaiHI,
Some what similar to thread .. How to change the system no | SCN -
Template Blueprint for management and legal consolidation for BPC 7.0 NW
Hi Gurus,
Does anyone have a template buleprint document for starting with management and legal consolidation in BPC 7.0NW
If you have request you to share me the documents
appreciate your help and many thanks in advance
DeepakHi,
please find big volume of information from these threads
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40b25a12-7082-2b10-5c86-c227b9397fb3?overridelayout=truehttps://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b09d5f42-36a4-2b10-cb82-fa58febeb7c2?overridelayout=true
Re: Consolidation for SAP BPC
also you can get latest information from
http;//service.sap.com/pam
regards
nag -
Oracle service bus: Work manager and Throttling
Hi
Flow is PS_C--->BS_A (based on PS_A)
I created a http protocol based proxy service PS_A and a business service based on PS_A, i.e. BS_A.
Now this BS_A is deployed on four different managed servers. I have implemented failover so at a time copy of only one of the managed severs will be accessed by multiple external clients through PS_C. To say all will hit Managed server-1 copy of BS_A. If Managed server-1 is down then it will hit Managed server-2 copies of BS_A.
I have created a workmanager named "CustomWorkManager" which has MaxThreadConstraint=1. PS_A has not enabled CustomWorkManager. i.e. PS_A works under default policy.
My goal is to process only one request at one time through BS_A.
In business service, BS_A I can see work manager and throttling options.
My question is this:
Scenario I: I make throttling enabled and set maximum concurrency=1 for BS_A
Scenario II: I apply CustomWorkManager to BS_A
Scenario III: I do both Scenario I and Scenario II
What is the difference between I, II and III?
Fundamentally, what is the difference between throttling with maxConcurrency=1 and MaxThreadConstraint of workmanager=1 for a http business service?
Thanks and Regards,
Swapnil Kharwadkar@Abhishek: Thanks for descriptive reply.
@Anuj: Thanks for links, I am having a look..
Use case:
What is the target app/service? Is it DB, HTTP or anything else?
Back end: Amadeus web services
Role of DB:
1. It will store data to attach transaction context to a request. This is to call more than one services in the backend - it is necessary for backend to understand in which context services are being invoked.
For example, if I need to make PNR related changes, I need to invoke service X and fetch transaction context from back-end. The transaction specific identifier (read session) will be received in header part. After retrieve suppose I need retrieve PNR, I will invoke service Y. When I invoke, I need to put the transaction specific header part received in response of service X and then change body as per request format of service Y (read the response header of X will be the same as request and response header of Y) which will actually make changes and commit in the backend. (So back-end will understand that service X and Y are invoked as a part of single transaction, and transaction can be identified through logs)
3. Once my X+Y call is over and transaction is committed, the context for transaction specific part received in header to the transaction is removed from back-end. Then I can use session again for the next transaction.
4. To re-use session I am storing it in DB and retrieving as per need for each call to Amadeus.
Problem is, it is absolute necessary for all transactions which are being processed simultaneously, to have unique session in header.
For example,
I do the following:
Request 1: receives session from service X, uses for service Y. After use, inserts session in DB. Now context for that session is removed from back-end.
Request 2: looks for session DB, puts in header and invokes backend. Context for Request 2 is attached to session retrieved from DB.
Request 3: looks for session DB, puts in header and invokes backend. Context for Request 3 is attached to session retrieved from DB.
As you can see if Request 2 and Request 3, pick up the same session from DB and invoke back-end, back-end services won't be able to understand which request the session belongs to, and will fail both requests. Ideally Request 2 should retrieve it from DB use for itself and Request 3 should make a call to service X at back-end to receive context. With this new context Request 3 should proceed for transaction.
Why are you using a BS to call from one Proxy to another Proxy?:
1. To interact with DB, I use DBAdapter business services with QueryByExample/Update/Insert operation.
2. My PS_A is proxy which orchestrates these operations. (Read: SelectandUpdateDBForSessionRetrieve, UpdateDBWhenTransactionOver functionaries) Since there are two admin and four managed servers, all copies of PS_A will try to access DB simultaneously, and concurrency will fail.
3. Hence I made BS_A on the basis of PS_A. BS_A is deployed on all four managed servers, used Load Balancing Algorithm as "None" and gave hard-coded urls of four managed servers in sequence of MS1, MS2, MS3 and MS4.
4. Idea is if MS1 is ok, all requests will go to BS_A of MS1 only, and if somehow if I make it single threaded *(Read from DB+mark retrieved data as "in use" so other request can not use it)*, concurrency issue will not arise. In case MS1 is down, the requests will automatically forwarded to MS2 and since that is also single threaded, concurrency issue won't arise. In short both fail-over and concurrency can be achieved with BS_A making out of PS_A.
The problem as you have correctly pointed out, is that OSB is stateless and one request has no relation with another. Somehow, I need to make every retrieve/update/insert to database as single threaded, i.e. once one is done then another should not be done at the same time. Else entire point of this pooling will fail.
Please share any thoughts you might have. Even another approach to handle this single threaded need will do.
Thanks and Regards,
Swapnil Kharwadkar -
How to take OIM Managed server Thread Dump
Hi All,
how can i take the oim managed server thread dump
I used wlst command for this lyk follows
kill -3<pid>
./wlst.sh
connect("weblogic","password","t3://hostname:port")
threadDump()
but it is giving Admin server dump, i want oim managed server threadDump how can i get thishi kalyan,
after connecting to wlst
i tried these steps
cd('Servers')
cd('server_oim_DEV')--which is my managed server name
threadDump()
after this i got the threadDump but i dont think so i am getting different file
when i open this it is mentioned lyk Admin server dump
is this the ryt process and can i know the ryt process to take managed server thread Dump -
WLS Management and Administration Survey
The WebLogic Server team needs your input. We are working to improve the
experience of WebLogic application development and deployment, with an
emphasis on configuration management, monitoring, and problem diagnosis of
both the server and your deployed business logic. To do this, we are looking
to you, our users, for input about the processes and tools your team uses to
deploy and manage reliable J2EE applications on the WebLogic Application
Server.
In order to hear from you, we are asking for your participation in a short,
online survey. This survey is targeted to WebLogic Server operators and
application administrators. It includes questions that ask you to discuss
your development and administration team, your current applications and
projects, the practices and policies you employ to insure application
reliability and manageability, and the tools you use or need in your
production and test environments.
If you are willing to participate, the survey is available online by
visiting:
http://www.surveymonkey.com/s.asp?u=85377130222
Please be sure to complete the section desscribing yourself and your role in
the organization you represent so that we can use your data to improve
WebLogic Server.
Thank you, in advance, for your input,
BEA WebLogic Server Development TeamI replied to your post here http://forums.adobe.com/thread/1114070.
Maybe you are looking for
-
PS/2 mouse no longer works after update
I just updated my system, and now the mouse doesn't work. The cursor is stuck in one area of the screen. I can move it a few centimeters in any direction, but it snaps back to the original position when I stop moving the mouse. The problem is rather
-
I can not open pages it keeps telling me to download the lates verison, does anyone know where that is?
-
Do I need to tune the base query of my materialized view ?
Hi gurus, We implement materialized view (FAST REFRESH ON COMMIT) on base table used in OLTP system. In fact the MV itself is also queried by the OLTP system itself, interactively. Currently user complain that after they input transaction, they see t
-
Viewobject / preparedstatement
JDeveloper 11.1.1.20. Is it possible, from within java-code in an Oracle ADF application, to retrieve data from a database table using a viewobject without interfering with the application? Altering the viewobjects where-clause and executing the view
-
When trying to install 13.0.6 update to existing 13.0.2, I get the error message that the install failed. Is this because of incompatibility?