Db- put blocks sometimes, mulit-thread uses Db- put to write DB file
My environment : redhat Linux 5, gcc version 4.1.2
BDB version: 4.8.24
Hi Guys
I used multi-thread application to write DB file. The application used Transactional Data Store and I used flags DB_TXN_NOSYNC . The DB file type is BTREE. I give 180M for the buffer cache and 8M for the log cache. And I used Db->put to write DB file ; five threads is used.
But the Db->put will block for one or two seconds sometimes.
Now I have found that the problem is in the lock/lock.c :: __lock_get_internal , line 953 : MUTEX_LOCK(env, newl->mtx_lock);. My application blocks here .+_
Could anyone give me some advice to avoid these blocks as possible as we can?
By the way, I have tried many of the lock set APIs which BDB offered. No effect -_- .
Thanks
Hi,
You should have posted this new piece of information in the original thread you opened:
Db->put block sometimes , when mulit-thread uses Db->put to write DB file
In the future please do not open a new thread for a problem you already reported.
Now I have found that the problem is in the lock/lock.c :: __lock_get_internal , line 953 : MUTEX_LOCK(env, newl->mtx_lock);. My application blocks here .+_This only confirms that one of your threads is blocked waiting for a requested lock, which is already held by another thread. Until the thread that holds the lock will not have released it, your thread waiting on it will not make progress.
You can collect the locking statistics at the moment you observe the slowness using either the db_stat utility with the -CA or -Co options (if the environment is not opened with DB_PRIVATE, that is, backing its region files into per-process private/heap memory) or programmatically using DB_ENV->lock_stat_print():
[http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/db_stat.html]
[http://www.oracle.com/technology/documentation/berkeley-db/db/api_reference/C/lockstat_print.html]
Examining the locking statistics will help determine what is the problematic lock, what is the locked object and which thread is holding it.
In addition to standard deadlock detection you can look into configuring lock timeouts. If your lock request is not satisfied within a given time it will time out and return DB_LOCK_DEADLOCK or DB_LOCK_NOTGRANTED. Lock timeouts may be configured per environment wide basis or per-lock or per-transaction basis:
[http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/lock_timeout.html]
[http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_txn/C/lockingsubsystem.html#configdeadlkdetect]
As Mike already suggested it would help if you could put together a test case program to demonstrate this issue.
Regards,
Andrei
Similar Messages
-
onitoring a voltage and storing it to the same file under the associated header...What I'm having problems doing is after the loop is completed I need to write the MIN\MAX values of the voltage that was monitored in the "While Loop" once it completes. I juBefore the loop the "Concatenate String" peforms the following... line1 col.1 in an excel file is (Tester then Line1 col.2 (the testers name appears) next is a end of line. Then Line2 col.1 is (DATE)header then col.2(TIME)header then col.3(throttle voltage output)header then col.4(MAX VOUT)header then col.5(MIN VOUT) as i said this is perform before the loop with no pr
oblem. Next during the "While Loop" the actual information for the DATE,TIME,Throttle voltage output,are inserted into Line 3 under the associated header with no problem. What I need to do is wait until the "While Loop" has completed to then store the MAX/MIN, but I can't seem to get the information to end up under the associated header. What do I need to set/use to accomplish this task? Thanks I've attached an excel spread sheet to give an example of where I need the values to be stored.
Attachments:
test1.txt 1 KBonitoring a voltage and storing it to the same file under the associated header...What I'm having problems doing is after the loop is completed I need to write the MIN\MAX values of the voltage that was monitored in the "While Loop" once it completes. I juThis can become hard depending on how much data you will be writing. If you could wait and write the data all at one at the end of the while loop it becomes easier. The problem is that when you write a file it writes it in rows of data not columns. I will attach an example (LabVIEW 6.0) that demonstrates how to do this. It is a hard to describe in text. Basically I create the new columns of data and write empty strings to them on each iteration of the while loop except for the first iteration. The first iteration I write a Max? and Min? into the column information. After the while loop is completed I search the array for Max? and Min? and replace it with the appropriate min and max values.
Attachments:
append_column.vi 47 KB -
Hello,
I have a multi-threaded application but the main thread doesnt blocks the application so the application quits just after started. Im using this code to block the main thread:
/*BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
for(;;) {
try {
r.readLine();
catch (IOException e) {
I tryed to just use for(;;){} but it causes 100% of CPU using. This code above its very dangerous because sometimes System.in blocks the entire application (all threads)
Thanks a lotThis application its a socket server, Im doing:
main {
Thread1 - createServer();
Thread2 - createLogging();
waitForServerShutDown();
the createServer method must be placed in a thread, its must not blocks the application because createLogging(); must be executed just after the server was created and createLogging(); doesnt blocks the application then... I must block the main{} to keeps application running -
Azure Rest API PUT Block Blob Returns "The specified resource does not exist" CORS
I am trying to upload a file to Azure Blob storage. For some reason when I try to put a new block blob on in the storage it tells me the resource does not exist. I am sure it is something silly I am missing.
According to the documentation:
The Put Blob operation creates a new block blob or page blob, or updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the
existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List (REST API) operation.
CORS is setup and that seems okay.
When I do a preflight and get this:
Request URL:https://<account>.blob.core.windows.net/test/image.png
Request Method:OPTIONS
Status Code:200 OK
Request Headers
OPTIONS /test/image.png HTTP/1.1
Host: <account>.blob.core.windows.net
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
Access-Control-Request-Method: PUT
Origin: http://www.<site>.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36
Access-Control-Request-Headers: accept, content-type
Accept: */*
Referer: http://www.<site>.com/azure/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Response Headers
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: Blob Service Version 1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 0d372e95-1524-460a-ab9c-7973d42a7070
Access-Control-Allow-Origin: http://www.<site>.com
Access-Control-Allow-Methods: PUT
Access-Control-Allow-Headers: accept, content-type
Access-Control-Max-Age: 36000
Access-Control-Allow-Credentials: true
Date: Thu, 27 Feb 2014 22:43:52 GMT
But when I make the PUT request these are the results.
Request URL:https://<account>.blob.core.windows.net/test/image.png
Request Method:PUT
Status Code:404 The specified resource does not exist.
Request Headers
PUT /test/image.png HTTP/1.1
Host: <account>.blob.core.windows.net
Connection: keep-alive
Content-Length: 22787
Cache-Control: no-cache
Pragma: no-cache
x-ms-blob-content-dis; filename = "image.png"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36
Content-Type: image/png
x-ms-blob-type: BlockBlob
Accept: application/json, text/plain, */*
x-ms-version: 2013-08-15
Origin: http://www.<site>.com
x-ms-date: Thu, 27 Feb 2014 23:19:19 GMT
Referer: http://www.<site>.com/azure/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Response Headers
HTTP/1.1 404 The specified resource does not exist.
Content-Length: 223
Content-Type: application/xml
Server: Blob Service Version 1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: d5a60c8b-356a-44ff-93af-0ea720b5591f
x-ms-version: 2013-08-15
Access-Control-Expose-Headers: x-ms-request-id,Server
Access-Control-Allow-Origin: http://www.<site>.com
Access-Control-Allow-Credentials: true
Date: Thu, 27 Feb 2014 23:22:42 GMTYour request must be authenticated to be able to upload a blob. Please see our
Windows Azure Storage: Introducing CORS blog post for more information on using Shared Access Signatures with CORS. -
I know that a thread can be blocked on an I/O operation? I/O can block a thread for a considerable amount of time, particularly if network communication is involved. For example, a server may be waiting for a request, or a network application may be waiting for an answer from a remote host.
Now my question is that while the thread is blocked, the processor is still doing some work, so on a single processor machine, during the I/O block would another thread start working or would it be a more sequential env still.I'm not entirely sure if I understand your question, but I give it a try:
It's entirely possible and quite common that one thread is waiting for I/O and other threads of the same (or another) JVM keep running. That's one of the reasons why many servers use one thread per client. It doesn't matter if the machine has only a single CPU or multiple in this context. -
Changing ThreadPoolExecutor to prefer thread use to bounded queue
I would like to extend ThreadPoolExecutor to create new threads up to maximumPoolSize and then put tasks onto a bounded queue. (Kind of a cross between Fixed and Cached thread pools).
It seems that the only place to do this would be to rewrite the execute method of ThreadPoolExecutor and swap the following commands
if (workQueue.offer(command)) // Swap this
return;
Runnable r = addIfUnderMaximumPoolSize(command); // with this
if (r == command)
return;
if (r == null)
reject(command).
...However with most methods and vars private in ThreadPoolExecutor, overriding this method is nearly impossible.
Is there a better way of doing this?
Thanks,
Chrisnope - there is no chance. sadly not! otherwise i would have integrated it into my templates
btw - you could change all the links into a rollover, but that would mean that ALL links are a rollover.
another way is to use iwebmore to edit the template files: http://iwebmore.ctrl-j.eu/iWebMore.html
max karreth -
Weird blocks on image after using adjustment brush in ACR
A group of people took an online webinar yesterday. The instructor is a heavy Adjustment Brush user, in LightRoom. After taking the class, many of the students in the group are reporting the appearance of weird blocks on images, after using the Adjustment Brush - both in LR and in ACR. It is also happening to me. I am a heavy Photoshop and ACR user - never before have I seen this. The only thing I'm doing differently is using the Adjustment Brush (because of the webinar class, as it was part of the instructor's core teachings). What could be causing this?
There was an adjustment brush bug in older versions of ACR. I first reported it here, and Eric Chan acknowledged the problem. It went away in future releases. Sorry, I can't remember what version numbers were involved.
http://forums.adobe.com/thread/928672
(see youtube demo) -
My ipod is blocked and i cant use it how do i unblocked
My ipod is blocked and i cant use it how do i unblocked
If you mean disabled:
Disabled
Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
iOS: Forgot passcode or device disabled
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
For how to restore:
iTunes: Restoring iOS software
To restore from backup see:
iOS: Back up and restore your iOS device with iCloud or iTunes
If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
You can redownload most iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode. -
Block list how to use "*"?
I want to block a whole domain like
[email protected]
[email protected]
then I want to use a add-on or some software to put block *hotmail.com ?
Do not ask me to use filter inside thunderbird.......
because I have many many span every single day.
filter rules is too trouble for that.
I want to create a my black block list but with *
a true example, [email protected]
after I block it or even I block the whole domain @as.alltradebuyer.cn
the next day it will show up as bs.alltradebuyer.cn
Please help and let me know, thanks everybodyhi brother,
tks for your reply.
my problem is, I cannot trust the spam software, because maybe one of those emails are important to me.
So, I need to check it each single one.
But for the one that I am sure sure it is spam, I will block the whole domain forever.
So, add-on like spamassin do not work much on me.
I am using "email security plus" but no such function to block the whole domain.
and usually spam website will do a next level domain like
a.hotmail.com
b.hotmail.com
maybe because first level domain take money I guess.
But blocking the first level domain will be the most efficient.
Hugo
''Gnospen [[#answer-679748|said]]''
<blockquote>
'''trysuger [[#answer-679593|said]]''
<blockquote>
Dear, that is too trouble !!!!!
I have at least 40s each every day........
Can have a add-on can do that?
</blockquote>
There are some spam-fighters but you probably have one in your antivirus/security-program. Mine marks the emails header with spam and I have a filter moving them to spam. My antivirus uses an outside list for evaluation. So does most of other spam-fighters. To much work, you say, but what list know what you define as spam. If you want to stop all users of hotmail sending to YOU that's ok as long as you don't block my brother from me. Which would happened if you could update that outer spamlist.
You need a private list and you have to teach it yourself. And one way is marking them as spam with a filter. And deleting all spam by hand or automated.
</blockquote> -
Blocking the Instrument in use during calibration
Hi Masters
Is there any possibility to block the instrument in use which is under calibration in SAP?
-MohanHi
Do you means the Inspection lot is generated for a Equipment which is under calibration ,then there is no std SAP function which will block equipment automatically after you take UD of the calibration lot.
But
You can always go to IE02->equipment>functions-->either Deactivate the Equipment or put deletion flag.
Also you can create User status for Equipments like
CALB Calibrated
UNRP Under rapaire
NIU Not in Use
etc
SO that equipment will not be scheduled again.
I hope this will add some value.
Regards
Sujit -
HttpConnection blocking ALL MIDlet threads?
Hi there,
Geez, I am pretty depressed as I seem to be too incompetent to implement the most basic HttpConnection use case. My MIDlet needs to issue a single HTTP POST request during the complete MIDlet lifetime. Pretty basic, one should think. I spawn a main thread for the MIDlet, from the main thread I spawn a thread for the HTTP connection. However, once the connection thread blocks, the main thread seems to block, too. Let me give you some minimal code that reproduces this behaviour.
Here's the MIDlet. It simply creates the main thread in startApp().
import javax.microedition.midlet.MIDlet;
public class Connection extends MIDlet
protected void destroyApp(boolean force)
protected void pauseApp()
protected void startApp()
System.out.println("Starting main thread");
new Thread(new MainThread()).start();
}Here's the main thread. It just creates the connection thread and then either sleep()s for 5000 ms or wait()s for 5000 ms. It also measures how long the sleep() or wait() actually took. The idea is to go back to the user after the timeout and tell him/her, sorry, it did not work out. That's enough for me. I don't even have to shut down the connection thread.
public class MainThread implements Runnable
private synchronized void waitFor5000ms()
try
wait(5000);
catch (InterruptedException ex)
ex.printStackTrace();
private void sleepFor5000ms()
try
Thread.sleep(5000);
catch (InterruptedException ex)
ex.printStackTrace();
public void run()
System.out.println("Main thread method entered, now starting HTTP thread");
new Thread(new HttpThread()).start();
System.out.println("HTTP thread started, now waiting for 5000 ms");
long startTime = System.currentTimeMillis();
if (true)
waitFor5000ms();
else
sleepFor5000ms();
long duration = System.currentTimeMillis() - startTime;
System.out.println("Waited for 5000 ms, which took us " + duration + " ms");
}And here's the code for the connection thread. For the sake of brevity it only contains the statements that are required to reproduce the problem. I am deliberately using an IP address that does not exist in my test network to see how my code behaves under this error condition.
import java.io.IOException;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.io.StreamConnection;
public class HttpThread implements Runnable
public void run()
try
System.out.println("Connection thread method entered, now opening connection");
StreamConnection streamConnection = (HttpConnection)Connector.open("http://192.168.123.234/blah.html");
System.out.println("Connection opened, now setting request method");
((HttpConnection)streamConnection).setRequestMethod(HttpConnection.POST);
System.out.println("Request method set, now opening output stream");
OutputStream out = streamConnection.openOutputStream();
System.out.println("Opened output stream, now writing byte");
out.write(0);
System.out.println("Wrote byte, now flushing output stream");
out.flush();
catch (IOException ex)
ex.printStackTrace();
}So, here's how the code behaves. The out.flush() method invocation in the connection thread blocks, as it causes the HTTP connection to get established. HOWEVER, the main thread blocks, too. So, the sleep() or wait() does not take about 5000 ms, but more than 20000 ms. The main thread seems to only continue executing once out.flush() returns. Bizarre. Here's the output of the MIDlet. It is basically the same for WTK 2.2 (Windows and Linux), WTK 2.5.1 (Windows), and the SonyEricsson SDK 2.2.4 (Windows).
Running with storage root temp.DefaultColorPhone44
Running with locale: English_United States.1252
Running in the maximum security domain
Starting main thread
Main thread method entered, now starting HTTP thread
HTTP thread started, now waiting for 5000 ms
Connection thread method entered, now opening connection
Connection opened, now setting request method
Request method set, now opening output stream
Opened output stream, now writing byte
Wrote byte, now flushing output stream
javax.microedition.io.ConnectionNotFoundException: TCP open
at com.sun.midp.io.j2me.socket.Protocol.connect(+99)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+52)
at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+14)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+8)
at com.sun.midp.io.j2me.http.Protocol.connect(+73)
at com.sun.midp.io.j2me.http.Protocol.streamConnect(+57)
at com.sun.midp.io.j2me.http.Protocol.startRequest(+12)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+38)
at com.sun.midp.io.j2me.http.Protocol.flush(+36)
at com.sun.midp.io.BaseOutputStream.flush(+11)
at HttpThread.run(+76)
Waited for 5000 ms, which took us 21000 ms
Execution completed.
3423649 bytecodes executed
354 thread switches
1669 classes in the system (including system classes)
17953 dynamic objects allocated (546852 bytes)
3 garbage collections (465956 bytes collected)
I must be missing something pretty obvious as this is really pretty basic, isn't it? Any thoughts?
Thanks,
ThomasHey sailesh_dit,
Thanks for confirming this problem. So, it seems more and more to me that this is a general problem with at least some VMs and/or WTKs and not my fault. My current guess is that a blocking native call messes up the VM. Maybe I should open another thread with this as a subject.
I was just a bit surprised that this wasn't discussed anywhere. Everywhere I read "Run your networking code in a separate thread!" and nobody seemed to have run into problems with this approach, which left me a little confused. So, it is good to hear that you've also experience this problem.
Thomas -
please help me!!!! my macbook pro 15 running on mountain lion is hanging a lot...sometimes when i use any app than it get freeze for some seconds...what should i do?
Hardware Information:
MacBook Pro - model: MacBookPro8,2
1 2.2 GHz Intel Core i7 CPU: 4 cores
4 GB RAM
System Software:
OS X 10.8.2 (12C60) - Uptime: 0 days 1:17
Disk Information:
TOSHIBA MK5065GSXF disk0 : (500.11 GB)
disk0s1 (disk0s1) <not mounted>: 209.7 MB
Macintosh HD (disk0s2) /: 499.25 GB (424.92 GB free)
Recovery HD (disk0s3) <not mounted>: 650 MB
HL-DT-ST DVDRW GS31N
USB Information:
Apple Inc. BRCM2070 Hub
Apple Inc. Bluetooth USB Host Controller
Apple Inc. Apple Internal Keyboard / Trackpad
Apple Inc. FaceTime HD Camera (Built-in)
Apple Computer, Inc. IR Receiver
FireWire Information:
Kernel Extensions:
Problem System Launch Daemons:
[failed] com.apple.coresymbolicationd.plist
Problem System Launch Agents:
[failed] com.apple.afpstat.plist
[failed] com.apple.AirPlayUIAgent.plist
[failed] com.apple.coreservices.appleid.authentication.plist
[failed] com.apple.rcd.plist
Launch Daemons:
[loaded] com.adobe.fpsaud.plist
[loaded] com.adobe.SwitchBoard.plist
[loaded] com.google.keystone.daemon.plist
[loaded] com.microsoft.office.licensing.helper.plist
Launch Agents:
[loaded] com.adobe.CS5ServiceManager.plist
[loaded] com.google.keystone.agent.plist
User Launch Agents:
[loaded] com.adobe.ARM.202f4087f2bbde52e3ac2df389f53a4f123223c9cc56a8fd83a6f7ae.plist
[loaded] com.facebook.videochat.Akshay.plist
[loaded] com.microsoft.LaunchAgent.SyncServicesAgent.plist
User Login Items:
Sony Ericsson Bridge Helper
BitTorrent
uTorrent
3rd Party Preference Panes:
Flash Player
Java
Internet Plug-ins:
AdobePDFViewer.plugin
AdobePDFViewerNPAPI.plugin
Flash Player.plugin
FlashPlayer-10.6.plugin
googletalkbrowserplugin.plugin
JavaAppletPlugin.plugin
npgtpo3dautoplugin.plugin
QuickTime Plugin.plugin
SharePointBrowserPlugin.plugin
User Internet Plug-ins:
Google Earth Web Plug-in.plugin
Picasa.plugin
Bad Fonts:
None
Top Processes:
14.6 % WindowServer
6.9 % coreaudiod
6.4 % uTorrent
1.9 % WebProcess
1.4 % iTunes
1.2 % EtreCheck
0.5 % fontd
0.2 % NotificationCenter
0.1 % Dock
0.0 % Microsoft -
How to update delivery block in delivery(vl02n) using BAPI
hi all,
i have to update delivery block of a delivery using a BAPI. can any one suggest which bapi i have to use. and if possible let me know what are the mandatory fields that i have to fill in that bapi.
thank you all in advanceHI,
Use the BAPI BAPI_OUTB_DELIVERY_CHANGE..
Pass the delivery number DELIV_NUMB in both HEADER_DATA and HEADER_CONTROL..
In HEADER_DATA-DLV_BLOCK pass the delivery block.
In HEADER_CONTROL-DLV_BLOCK_FLG pass 'X'
Thanks
Naren -
Since itunes and apple tvs latest update I have had problem wtching movies on apple tv via my itunes can any one help, movie takes a very long time to load sometimes never, it use to work really well, whats going on please help?
You might find useful information in item D1 of Time Machine Troubleshooting.
-
I am putting together a slide show using iphoto and I wanted to add a description on each slide/photo. How can I do that? Also on the choice of music for the silde show, if the slide show is longer than one song can you chose a different song for background music?
This might help
http://www.apple.com/findouthow/photos/#slideshow
Regards
TD
Maybe you are looking for
-
Is there any way to access the files to be sent by XML bursting process?
Hi All, I have following problem (11i, 5.6.3): - XML output will be created from report - bursting process will e-mail to multiple addresses after converting to PDF using RTF template - now I need to split the output again (like XML bursting does bef
-
Buttons created in InDesign, exported to flash
Good evening, I need to deal with different geometric shapes (about 200) designed in InDesign, such as buttons: 1: click the left should change color, and reclick must return to the old color; Let me know if laying out everything to get what is writt
-
I'm trying to develop a java stored procedure on Oracle 10.1.2 that makes use of many other libraries, (Axis, WSIF, custom libs), and I'm stuck on this permissions error. I've loaded all of the libs into the same schema under the same user, (with JAV
-
Upgrading Windows 8 to 8.1 [Native VHD Boot]
Hey folks, I've got Windows 8 RTM running in a native VHD on my Dell Latitude E6430. I just tried to initiate the upgrade to Windows 8.1 by extracting the Windows 8.1 ISO with 7-Zip, and launching setup.exe from the extracted folder. Unfortunately, w
-
Problem transferring video to Ipad
I am a newbie to Ipad. 2 weeks ago I managed to transfer some purchased videos onto to my Ipad. Last weekend I transferred some songs (all through iTunes) and as a result the videos disappeared from my device. what option must I choose so that this w