Programming :: Suspend/resume A Thread When Using Pthread.h?

Dec 14, 2010

I want to suspend/resume a thread. The library I am using is pthread.h.I am also running my application on linux.Is there any function in pthread. let me suspend a thread temporary?I have read a document in which it was mentioned thatthread does not support suspend/resume

View 4 Replies


ADVERTISEMENT

Programming :: Rules To Set The Pthread Stack Size - Compute The Memory Needed By Each Thread?

Jul 26, 2010

i have an application that launches several pthreads, i know that the default size used by Linux is 8Mb for each pthread. However i would like to optimize the total memory usage by my application by decreasing the default stack size of each pthread to the needed resources. My questions:

- Are there any rules to set the pthread stack size.
- How to compute the memory needed by each thread.
- Is the malloc call inside a thread counted from the stack size of the same pthread?

View 2 Replies View Related

Programming :: Pthread - Take String From The Command Line And Creates A Thread To Print The String

May 3, 2011

I've been trying to understand pthread in C a little better. So I made a simple program that takes in a string from the command line and creates a thread to print the string. I've looked online and copied the basic concepts but there are something things I'm confused about. The programs works just fine, but I have questions. Here's what I have so far.

[Code]....

One thing I'd like to know is why the 3rd argument in the pthread_create function which is my SendMessage function needs to be typecasted to a void pointer and then send the address of the function. Also as for the 4th argument, I would see typecasting to void pointer in some of the pthread examples I saw online, but in my case I'm passing a char pointer, would this be correct? In which case would I ever want to pass a void pointer?

Do I need a pthread_exit(NULL) in my main and in the SendMessage function? If so, why? I added the sleep() function so that I could let the pthread_exit function in my SendMessage function execute first. I simply saw that the online examples on pthread had pthread_exit() in both locations.

View 6 Replies View Related

General :: 1:1 - What's Meant By There Is Kernel Level Thread For Each Pthread Created

Mar 11, 2011

I have gone thorugh some documents about pthread (NTPL ) in linux 2.6 kernel. As per that linux uses 1: 1 threading model and for each user level thread there is kernel level thread. Pthread_create uses clone system call to create a LWP and the kernel could treat that as a LWP and do scheduling and all .( different from linuxthread). My question is what's meant by there is kernel level thread for each pthread created. Can I see the kernel level thread if I call pthread_create using ps .

What exactly meant by 1:1 .I mean for each user level thread there is kernel level thread . If I make a system call from a thread does the OS services that action via kernel thread ( created using kernel_thread () or some other way ) internally ..

View 1 Replies View Related

Programming :: How To Bind Thread To Specific Thread In Multithread Application?

Dec 25, 2010

I am going to use "pthread_setaffinity_np" to bind a thread to a specific core. My application has two threads. I have used mutex to assign a specific id to each thread and then bind that thread to a core different from another core. but it seems that the os assigns both thread to one core.What should I do to bind each thread to a specific core?

View 4 Replies View Related

Ubuntu :: Can't Resume From Suspend?

Apr 6, 2010

My laptop won't resume after it suspends. It works fine under win 7 so it's not the hardware. The light says it's on and it's pretty much a blank screen. I'm not sure whether it's operational but the screen is off. It has exactly the same resault a waiting for the blank screen except it won't go back on.

View 9 Replies View Related

Ubuntu :: 10.04 Log Out When Resume From Suspend?

May 6, 2010

I've just upgraded from 9.10 to 10.04 via the upgrade manager. Prior to the upgrade I was able to suspend and hibernate without any problems. Now that I have upgraded to 10.04, I can suspend however when I resume I am back at the gdm login prompt, logging in again with a new session.Having just done another test whilst writing this, it actually appears that if I select suspend from the top right I am suspended and can resume my session. If I close the lid on my laptop (which is supposed to suspend) I am logged out and suspended.Also, Hibernate doesn't work as well - sometimes it never actually hibernates (just sits on a black screen) and sometimes it doesn't resume (it's never hibernated and resumed correctly since the upgrade)

View 9 Replies View Related

Debian :: Suspend To Ram - Resume Bug In Squeeze?

Mar 10, 2010

I have an issue with my Sony vaio fw31e not resuming from suspend. Reported this as a bug: [URL] The usual ways of suspending, from the kde 4 menu, from the power/battery widget or by lid closing always result in no resume. However, running pm-suspend from a root terminal suspends and resumes just fine. My question is, how does one delve into the way that the usual methods initiate suspend? Maybe if I could find out what each of these methods actually does, I may be able to see what is going wrong? I had been running squeeze on this lappy since July 2009 with no suspend issues until an update broke it sometime in January. The install is being fully upgraded every day at the moment.

View 11 Replies View Related

Fedora :: Suspend / Resume With F14 Radeon Kms?

Nov 13, 2010

It all works if I boot my self compiled vanilla 2.6.35-rc3 though. The environment

Sony vaio VGN-SR21M 4GBRAM P8400, ATI HD3400 mobility. I use

kernel-2.6.35.6-45.fc14.x86_64
xorg-x11-drv-ati.x86_64-6.13.1-0.3.20100705git37b348059.fc14

If I suspend my notebook it starts the usual slow orange blinking indicating the suspend mode got reached. There is also evidence in the various log files that this works. If I try to resume it hangs a for 3 seconds and then I get the hdd-password screen from my bios and the notebook boots from zero. I couldn't find anything in /var/log/messages nor dmesg. If I first boot to windows (grub 2nd partition) and then restart and boot to linux, all the suspend works fine

View 1 Replies View Related

Fedora :: Resume From Suspend Without A Password?

Jun 22, 2011

how do i disable the screen lock after i wake my computer from suspend? i would prefer to be able to just wake the computer up and have it go right to the desktop, without having to enter a password. i used to use ubuntu until today, and i remember having to run "gconf-editor" and then switching off on "lock_on_suspend" under apps/gnome-power-management from the menu that popped up. i tried to run "gconf-editor" in fedora 15, but that doesn't appear to exist. i've searched around and haven't been able to find an answer, so i'm wondering if anybody knows what to do?

View 3 Replies View Related

OpenSUSE Hardware :: Suspend And Resume In 11.2 And KDE 4.3

Mar 3, 2010

I've upgraded 4 boxes (32- and 64-bit) from Suse 11.1 to 11.2 with no unresolvable issues. Now I'm stuck with my 5th box, a Dell Dimension 8400 desktop box (yes, an old brick, 32-bit). I can suspend to RAM ("suspend") and to disk ("hibernate") fine, but resume seems to fail. In Suse 11.1 I used kpowersave (GUI in the sys tray) to suspend to RAM. For some reason, it couldn't suspend to disk but that didn't bother me. kpowersave relies on the powersaved running.

Note I had upgraded my 11.1 installation to all shiny and new KDE 4.3 stuff, and while KDE 4.3 seems not to use powersaved (and thus kpowersave) all worked fine. Upgrading to 11.2 has removed kpowersave and powersaved. I don't mind switching to another way if only I could find documentation what's being used on KDE 4.3 (and/or Suse 11.2). All I find by googling is that the daemon used is powerdevil, and that I should use a GUI for suspending (this battery monitoring plasma app).

Well, if I do that on this box it simply does -- nothing. So I tried s2ram and a2disk directly:Running s2ram with the --force option works, but the box doesn't resume. Goes on, screen stays blank, mouse and keyboard don't work. s2disk complains about not being able to "stat the resume device file". I gave it the --resume_device /dev/sda6 option, and it hibernated fine. But it doesn't resume. Pressing the power on button just starts Suse anew (and recovers the file system journals, so I assume it thinks it has crashed before).

So I think I have 2 questions:
What the heck does Suse 11.2 use for suspend/hibernate and resume? Is there any how-to available to learn what I need to configure?
Why can't I resume from successful s2ram or s2disk operations? /var/log/pm-suspend-log or pm-powersave-log don't provide any clues.

View 9 Replies View Related

Ubuntu :: Laptop Will Not Resume After Suspend

Apr 22, 2010

Whatever way I suspend my laptop (menu, keyboard shortcut, close lid), it seems to suspend just find (no panic lights, suspend LED indicator flashing as expected). However, when i try to resume, the laptop seems to begin the proper wakeup process (for example, the DVD-drive is tested), there's a lot of HDD activity for about 5 seconds, screen does not power on, and then the laptop just shuts off.

System setup:
lucid beta 2, fully updated (just check now)
LG E-500 laptop /w nvidia gforce mobile 8400G
bios version 1.17 from June 2007 (not sure this is important)

Things I tried:
* Completely remove anything to do with gpu drivers and installed nvidia-current driver.
* Suspend stress test described here. this didn't work at all. The first test failed (with ac adapter attached) and the second test suspended but didn't automatically resume (see "the behavior" above). Also, when I booted up again, no apport bug report is created. I tried both with rtc set to utc=yes and utc=no. with utc=yes, the second test did automatically resume, but the same problem happened (laptop shutdown while resuming).
* The debugging steps described here, but I couldn't get the "no_console_suspend" option to work. I tried adding both "no_console_suspend" and "no_console_suspend=1" (without quotes) to the boot script in the grub menu, but when I did pm-suspend in tty1, the laptop really did suspend. I would like to try to do this again if someone could explain how to add this option.

Notes:
* Not sure this is relevant, but when I boot up after a failed resume attempt, wireless network is disabled (this only happens after a failed resume!!!).
* I found a package called nvram-wakeup in synaptic that seems to be related to this. This package is not installed. Should I install it?
In case this is relevant, forgot to mention I'm running ubuntu in dual-boot along side windows7.

View 6 Replies View Related

Ubuntu :: Desktop Will Not Resume From Suspend 9.10 Or 10.04

Apr 25, 2010

I don't have any problems with 9.04 at all with suspend & resume just shutdown (wont power off usb saitek keyboard & razer mouse) but i don't care for that I prefer suspend & resume. However trying 9.10 suspend works while resume gets a black screen & locks up. Now on 10.04 it will suspend very fast but will not power up from resume keyboard & usb power is turned off thats what I can't figure out I have checked bios & changes settings after settings & nothing happens. I know in windows everything works but i do not want windows at all I prefer linux (ubuntu). In my asus eee pc 1001p suspend & resume works with both 9.10 & 10.04.

View 7 Replies View Related

Ubuntu :: No Screen When Resume From Suspend?

May 21, 2010

When I close my laptop lid (it goes into suspend mode). When I open it again, I can't see anything but a black screen. I have to reset the computer manually to accessUbuntu again.On a related note probably.. for 'some' screensavers, when I click to re-access my desktop, the screensaver freezes, but I can't see the unlock dialogue. I can however still type my password and it will unlock, I just can't see what I'm doing

View 2 Replies View Related

Ubuntu :: Resume From Suspend Without Password?

May 29, 2010

in kubuntu how can i resume from suspend without password? it annoys the crap out of me i have been looking all over and cant find anything in settings to do this

View 3 Replies View Related

Ubuntu :: Resume From Suspend Not Working 9.10?

Jul 31, 2010

Karmic 2.6.31-22-generic, Asus M3N78-EM, MCE remote with USB/IR dongle, latest Bios, Bios PM enable and set for suspend S3. IT will suspend but I need to depress case power button for it to resume. I want to use my remote control, I also can not get it to resume from Keyboard/mouse (See Note Below). Only suspend and power button work.

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[code]....

View 1 Replies View Related

Slackware :: 13.1 - Suspend / Resume With 2 Different Laptops

May 29, 2010

Laptop 1 is an acer aspire 5570. closing and opening the lid works a few times, after editing acpi_handler.sh, and battery life reporting is ok during this time. then, for no apparent reason, the laptop no longer responds to the lid closing, and no longer seems to be able to read the battery charge state. once this has occurred, the computer will also no longer restart, it tries a few times, with lights flashing and the hd making ugly noises. the only way to extricate the computer from this state is to pull and reinsert the battery.

Laptop 2 is a gateway nv18. suspend/resume with the lid are ok, mostly. the issure here is no display at all in x. but the computer does respond to ctrl-alt-backspace to kill x, with the command prompt returning. still not good. I'm trying a fresh install on the gateway, to see if this was just an installation glitch.
Both laptops performed flawlessly in 13 otherwise.

View 9 Replies View Related

CentOS 5 :: Fail To Resume From Suspend?

Jul 12, 2011

I've been trying to find an answer to the following problem : whenever my PC is put in Suspend/Hibernate mode, it fails to recover when pushing the power button. This happens both with automatic suspend or manual suspend. I've been reading this problem, and mine is quite similar, but no solution is given.

uname -rmi
2.6.18-194.11.4.el5 x86_64 x86_64
PS: this computer is not connected to Internet, no update possible.

View 1 Replies View Related

Debian :: 8.0 Jessie Xfce Can't Resume From Suspend

Oct 9, 2015

I have a quite simple installation of Debian 8 Jessie XFCE and the resume from suspend is not working 9 out of 10 times. The system is single booted if that matters. I have found a few solutions to this problem but they were not suitable to my case as I don't have an Nvidia GPU but only Intel Onboard:

Code: Select all# lspci -v
00:00.0 Host bridge: Intel Corporation 82Q35 Express DRAM Controller (rev 02)
   Subsystem: Hewlett-Packard Company Device 2818
   Flags: bus master, fast devsel, latency 0
   Capabilities: [e0] Vendor Specific Information: Len=0b <?>
   Kernel driver in use: agpgart-intel

00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller])
   Subsystem: Hewlett-Packard Company Device 2818
 
[CODE]..

When I try to resume, I can hear the system booting but I can't see anything on the screen and the keyboard is not working either (no light on Num Lock and Caps Lock). The only option is to press the power button for a few seconds to stop the machine and then push again to start booting again.

View 13 Replies View Related

Debian :: Blank Screen Upon Resume From Suspend?

Jan 28, 2010

Up until a couple days ago, my computer had no problems suspending to ram. However, now when I suspend, and later hit a key on the keyboard (usually space) to resume, all I see is an illuminated black screen. I can't even open a tty via Ctrl+Alt+F1. I can however ssh into the machine.he only possibility I can think of is that I am no longer running kdm. I just use "startx" to star an openbox-session.

View 8 Replies View Related

Debian Configuration :: Laptop Does Not Resume From Suspend?

Jan 27, 2011

I have installed squeeze on a HP notebook. I have one small problem though.It does not resume from suspend. If I shutdown -> suspend, or close the the lid, or shut downs (suspends) as expected, but whenower it backup up, the screen just stays black.Hibernate is working fine.

output of lspci (if needed)
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)

[code]...

View 14 Replies View Related

Fedora :: Suspend/resume Not Working For Kernels After 2.6.29?

Aug 24, 2009

Starting with kernels 2.6.29.x and above (which includes 2.6.30.x and 2.6.31.x),whether obtained from "kernel.org" of from the "FC11 repository", none of theseresume properly after putting the computer to sleep (suspend)... in my case, via"pm-suspend".When I press the "On" button, I hear the fan, but get no video. And the fan neverreturns to the normal resumed, slower speed -- which it normally does after aroper resume.Eventually I have to issue "Ctrl + Alt + Delete" to reboot. So the computeris resumed to some degree (to have been able to accept that sequence), butnot all the way - no video (and who knows what else)Any ideas -- I've searched high and low. Are there new kernel parametersI have to be aware of when I do a "make oldconfig", and go from there?

View 4 Replies View Related

Fedora :: System Degraded After Resume From Suspend

Jun 17, 2011

I am having a problem with suspend in F15. While the computer enters and resumes from suspend extremely fast (basically instantaneous), the whole system seems sluggish and unresponsive afterwards. The mouse cursor is lagging and some key strokes are omitted when typing. The animations in Gnome 3 are also very non-fluid compared to how they were before suspend. The only way I have found to return to normal operation is to reboot the computer. I have tried 32 and 64-bit versions of Fedora 15 with the problem existing in both. I also tried the latest version of openSuse (Gnome 2.32) just to see if this problem persisted and I can confirm that it did. Perhaps this indicates a kernel-related problem that should be reported as a bug somewhere else?

lspci:
Code:
00:00.0 Host bridge: Intel Corporation Core Processor DMI (rev 11)
00:03.0 PCI bridge: Intel Corporation Core Processor PCI Express Root Port 1 (rev 11)
00:08.0 System peripheral: Intel Corporation Core Processor System Management Registers (rev 11)
00:08.1 System peripheral: Intel Corporation Core Processor Semaphore and Scratchpad Registers (rev 11)
00:08.2 System peripheral: Intel Corporation Core Processor System Control and Status Registers (rev 11)
00:08.3 System peripheral: Intel Corporation Core Processor Miscellaneous Registers (rev 11) .....

View 3 Replies View Related

OpenSUSE Install :: Freeze On Resume From Suspend To RAM?

Mar 29, 2011

There is an intermittent problem with resuming from s2ram. Occasionally, the power button is pressed to resume, the screensaver comes on but the animation is frozen along with the mouse and KB. Sometimes the desktop will show although with the same frozen condition. My swap parition is 2GB. I read in the forums that a small swap partition may cause a somewhat similar condition. I also read a recommendation to disable powersaving and screensaver, again not for my exact symptoms. I would like to find the root cause even if it takes some doing. Otherwise, the system rocks (except Amarok never worked but Kaffeine works for sound). Here are the system specs:

openSUSE 11.3 x86_64
KDE 4.4.4. rel 3
HP xw9400 Workstation AMD 64 Opteron
OCZ Vertex 60GB (dedicated system drive-single boot)

[code]....

View 9 Replies View Related

Ubuntu :: USB Keyboard Locks Up After Resume From Suspend

Feb 20, 2010

When I suspend my computer and then resume later in the day my USB keyboard locks up. The only way I have found to reset the keyboard is to disconnect the USB cable from the USB port and then reconnect it.

View 9 Replies View Related

Ubuntu :: Computer Will Not Resume From Hibernate/suspend?

Apr 7, 2010

I just got a Dell Inspiron 1764 and am dual booting it with Win7 and Ubuntu 9.10.Whenever I hibernate or suspend, it goes through everything fine, but then when I resume it just boots to a black screen and I have to do a hard shutdown. Is there a fix for this? I know it's a fairly common issue.

View 1 Replies View Related

Ubuntu :: Thinkpad - No Suspend / Hibernate Or Resume

May 9, 2010

I've got a Thinkpad X31 with ATI M6 Ly card. Since Karmic, and Lucid, I get no suspend/hibernate/resume. If/when I select resume or close the lid, Lucid goes through the suspend cycle, and for approximately half a second it actually seems to go into suspend, then the screen comes back on, black, but definitely on, and absolutely no response to any keyboard input - have to hard-shutdown by holding down the power button. I've read that the problem is with the Ubuntu kernel, and that installing/compiling 2.6.33 fixes the issue, but causes other ones.

View 4 Replies View Related

General :: Resume From Suspend With Specific Device

Oct 23, 2010

I was trying to get this feature: wake up my htpc from s3 with my remote control and the solution is to modify /proc/acpi/wakeup and a descriptor in /sys. Here are the details: I'm using a Microsoft IR receiver for MCE remote that appears as dev 2 of bus 2 in lsusb

root@htpc:~# lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0471:0815 Philips (or NXP) eHome Infrared Receiver
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 045e:0714 Microsoft Corp.
Bus 001 Device 005: ID 045e:0715 Microsoft Corp.
Bus 001 Device 004: ID 045e:0707 Microsoft Corp. Wireless Laser Mouse 8000
Bus 001 Device 003: ID 045e:070c Microsoft Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub....

That's USB0 I have to enabled, why not usb 1 or 2 (bus 2 in lsusb)? Moreover why are all the disabled/enabled preceded with a star and S4 and not S3 mentioned? Nevertheless that wasn't enough to get it work. I looked in gconf-editor in apps/gnome-power-manager/general but I have no can-suspend or something similar... (I'm running on 10.10, with 10.04 I could suspend only once, afterwards the computer didn't go to suspend, just black screen then login screen). So I looked in /sys/ and found that 'cat /sys/bus/usb/devices/2-1/power/wakeup' (notice the 2.1 as bus 2 device 2 (0,1,...) gave 'disabled' so a echo enabled > /sys/bus/usb/devices/2-1/power/wakeup and now I can wake-up with the remote when I want.

What I don't understand:
Why USB0 in /proc/acpi/wakeup ?
Why have to change in /proc and /sys ?
Is it possible to automate this to get it work even if I change the usb port the receiver is plugged in ?

View 1 Replies View Related

Slackware :: Cannot Suspend And Resume - ThinkPad Edge 13 (AMD-ATI)

Jan 19, 2011

Slackware 13.1 installed clean on a new ThinkPad Edge (version 13 inch with AMD Processor and ATI graphics). I can get most of what I want working fine except for suspend and resume. I read somewhere that I should be using generic rather than huge kernel, so I have done that and scrapped ATI proprietary driver in case that was causing problems, but nothing so far has allowed me to suspend and resume with pm-suspend, acpitool suspend or with KDE suspend command. In all cases the screen blanks and the single ThinkPad red LED goes from on to blinking, but nothing seems to wake the machine up again. I had both suspend and hibernate working fine with Slack 13.1 on an older Lenovo laptop and ubuntu users report on their forums that this laptop does suspend and resume "out of the box" so I feel it must be possible.

View 4 Replies View Related

Debian Configuration :: No WiFi On Resume From Suspend Broadcom 43x?

Jan 10, 2011

I have just joined the Debian community, for the past 2 years I have been using Linux Mint (ubuntu), I am now using Linux Mint Debian 64. I have a Lenovo A700 ideacentre with a Broadcom 4313 WiFi card. I manage to get the card working, now I have a new problem. If I suspend the machine the WiFi will not connect on resume. Is there a simple command I can use to getting the connection restarted, or better yet a work around so it will restart on its own?

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved